Re: The PTS now produces Turtle RDF meta-data alongside HTML and RDF/XML - Was: Re: Some issues with the RDF export
On Friday 1. February 2013 10.59.33 Olivier Berger wrote:
> Hi.
Hi there!
So, I decided this email had been waiting with the "Important" tag for way too
long, since it has been some great work done here! :-)
> FYI, The PTS now implements an RDF export in the Turtle format which
> should be more easy to use that the XML variant that had been added
> previously.
>
> Turtle is supposed to be the best option for implementing Semantic Web
> and Linked Data applications nowadays.
Yup, definitly. Unless you work with a library that just serializes everything
for you.
>
> As an example, see for instance
> http://packages.qa.debian.org/a/apache2.ttl (or :
> $ curl -L -s -H "Accept: text/turtle"
> http://packages.qa.debian.org/apache2 )
Yeah, this is really great stuff! Very clear and readable Turtle, where the
semantics is well thought out.
So, my most immediate reaction is that it is very easy, in terms of triples,
to add a link to the upstream package, since you already have a description of
the upstream package, it is reasonable to simply use owl:sameAs, since they
are really the same thing. This would work for all CPAN packages, since Toby
Inkster has a Linked Data eksport of all CPAN packages, e.g.:
http://purl.org/NET/cpan-uri/dist/RDF-LinkedData/project
So, to link the Debian project to my upstream project, you'd add a triple
<http://packages.qa.debian.org/librdf-linkeddata-perl#upstream> owl:sameAs
<http://purl.org/NET/cpan-uri/dist/RDF-LinkedData/project> ;
and you can say
<http://packages.qa.debian.org/librdf-linkeddata-perl#upstreamsrc_0.56>
owl:sameAs <http://purl.org/NET/cpan-uri/dist/RDF-LinkedData/v_0-56>
to link to a versioned release.
I did the reverse for RDF::LinkedData, because that's easy to do manually:
https://github.com/kjetilk/RDF-LinkedData/blob/master/meta/project.ttl#L28
This points to the question on how one should do this generically, and with
minimal effort from the Debian Developer.
I'm thinking, perhaps maintaining a pointer to the upstream RDF and look for
the above link with a SPARQL query, so that the inverse can be recorded in the
Debian output, e.g.
CONSTRUCT
{ ?us owl:sameAs ?them . }
WHERE
{
?them owl:sameAs ?us .
FILTER (regex(str(?us), "^http://packages.qa.debian.org/"))
}
(totally untested) So, you would just record a URL to the upstream
description, and rely on that to maintain the link back to Debian. This would
be reliable, as it would involve no heuristics, but of course, one could also
employ some heuristics if upstream isn't doing anything like that. Most
wouldn't, but there are some big sources that do.
The next thing then would be to create a link between the versions of
releases. I tentatively did the reverse, but commented out for now:
https://github.com/kjetilk/RDF-LinkedData/blob/master/meta/changes.ttl#L17
This would require a more elaborate SPARQL query, but I could think about it
if there is interest in such an approach.
Cheers,
Kjetil
Reply to: