Generating RDF description of Debian package sources with ADMS.SW

Edit : I’ve now managed to roll out my contribution which is now in production on packages.qa.debian.org. See a later post I’ve made on the subject, and beware that the generated RDF has changed a bit also.

ADMS.SW proposes specifications for description of software present in software catalogues.

I’ve tried and apply it to the contents of the Debian Package Tracking System (PTS), using transformation of the information known by the PTS to RDF+XML.

The result is not yet in production, but here’s an example of what can be done, using the Turtle syntax (more readable) :

@base <http://packages.qa.debian.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22−rdf−syntax−ns#> .
@prefix admssw: <http://purl.org/adms/sw/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf−schema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix schema: <http://schema.org/> .
@prefix spdx: <http://www.spdx.org/rdf/terms#> .
@prefix : <http://www.w3.org/1999/xhtml> .
@prefix str: <http://exslt.org/strings> .

#
# First the packaging project for apache2 in Debian
#
# <http://packages.qa.debian.org/apache2> resource :
<apache2>
     a admssw:SoftwareProject ;
     doap:name "apache2" ;
     doap:description "Debian apache2 source packaging" ;
     doap:homepage "http://packages.debian.org/src:apache2" ;
     schema:contributor [
           a foaf:OnlineAccount ;
           foaf:accountName "Debian Apache Maintainers" ;
           foaf:accountServiceHomepage <http://qa.debian.org/developer.php?login=debian−apache@lists.debian.org>
     ], [
           a foaf:OnlineAccount ;
           foaf:accountName "Stefan Fritsch" ;
           foaf:accountServiceHomepage <http://qa.debian.org/developer.php?login=sf@debian.org>
     ], [
           a foaf:OnlineAccount ;
           foaf:accountName "Steinar H. Gunderson" ;
           foaf:accountServiceHomepage <http://qa.debian.org/developer.php?login=sesse@debian.org>
     ], [
           a foaf:OnlineAccount ;
           foaf:accountName "Arno Töll" ;
           foaf:accountServiceHomepage <http://qa.debian.org/developer.php?login=arno@debian.org>
     ] ;
     # pointer to the release in the different suites :
     doap:release <apache2_2.2.16−6+squeeze7>, <apache2_2.2.22−11>, <apache2_2.4.2−2>.

#
# Now the different debian package source releases
#
# <http://packages.qa.debian.org/apache2_2.2.16−6+squeeze7> resource
<apache2_2.2.16−6+squeeze7>
     a admssw:SoftwareRelease ;
     rdfs:label "apache2 2.2.16−6+squeeze7" ;
     admssw:project <apache2> ;
     dcterms:description "Debian apache2 source package version 2.2.16−6+squeeze7" ;
     doap:revision "2.2.16−6+squeeze7" .

# This one is the reference version for the PTS as in unstable, so
# contains more details than the others
<apache2_2.2.22−11>
     a admssw:SoftwareRelease ;
     rdfs:label "apache2 2.2.22−11" ;
     admssw:project <apache2> ;
     dcterms:description "Debian apache2 source package version 2.2.22−11" ;
     doap:revision "2.2.22−11" ;
     # this release contains two components
     admssw:includedAsset <apache2/apache2_2.2.22−11_debian>, <apache2/apache2_2.2.22_orig>
;
     # this release can be downloaded as one package (with dget)
     admssw:package <apache2/apache2_2.2.22−11.dsc> ;
     # it also has a related release somewhere else
     dcterms:relation <https://launchpad.net/ubuntu/+source/apache2/2.2.22−6ubuntu2> .
<apache2_2.4.2−2>
     a admssw:SoftwareRelease ;
     rdfs:label "apache2 2.4.2−2" ;
     dcterms:description "Debian apache2 source package version 2.4.2−2" ;

     admssw:project <apache2> ;
     doap:revision "2.4.2−2" .

# Then the .dsc file for the current unstable version
<apache2/apache2_2.2.22−11.dsc>
     a admssw:SoftwarePackage ;
     dcterms:description "Debian source package descriptor file for apache2 version 2.2.22−11";
     schema:downloadUrl "http://cdn.debian.net/debian/pool/main/a/apache2/apache2_2.2.22−11.dsc";
     schema:fileSize "2885" ;
     spdx:checksum [
           a spdx:Checksum ;
           spdx:algorithm <apache2#checksumAlgorithm_md5sum> ;
           spdx:checksumValue "d7d03719b9f6432beeecd3aa04f7b22c"
     ] .

#
# Then the upstream project
#
<apache2/apache2_orig>
     a admssw:SoftwareProject ;
     doap:description "The apache2 upstream project" ;
     # either its name or homepage can be matched against other ADMS.SW
     # or DOAP descriptors
     doap:name "apache2" ;
     doap:homepage "http://httpd.apache.org/" .

# And a upstream release 2.2.22
<apache2/apache2_2.2.22_orig>
     a admssw:SoftwareRelease ;
     rdfs:label "Upstream apache2 release 2.2.22" ;
     dcterms:description "Upstream source release for apache2 version 2.2.22" ;
     doap:revision "2.2.22" ;
     admssw:project <apache2/apache2_orig> ;
     # and a link to the upstream source tarball’s description
     admssw:package <apache2/apache2_2.2.22.orig.tar.gz> .

# now the (potentially re−archived) upstream source archive for that release
<apache2/apache2_2.2.22.orig.tar.gz>
     a admssw:SoftwarePackage ;
     dcterms:description "Upstream source archive for apache2 version 2.2.22−11 (potentially re−archived by Debian)";
     schema:downloadUrl "http://cdn.debian.net/debian/pool/main/a/apache2/apache2_2.2.22.orig.tar.gz";
     # Those 2 bits should help match packagings of the same tarball if needed
     schema:fileSize "7200529" ;
     spdx:checksum [
           a spdx:Checksum ;
           spdx:algorithm <apache2#checksumAlgorithm_md5sum> ;
           spdx:checksumValue "d77fa5af23df96a8af68ea8114fa6ce1"
     ] .

#
# Now, document specific details of the second component : Debian
# packaging files archive
#
<apache2/apache2_2.2.22−11_debian>
     a admssw:SoftwareRelease ;
     rdfs:label "Package sources apache2_2.2.22−11" ;
     dcterms:description "Debian packaging sources for apache2 version 2.2.22−11" ;
     doap:revision "2.2.22−11" ;
     admssw:package <apache2/apache2_2.2.22−11.debian.tar.gz> .

<apache2/apache2_2.2.22−11.debian.tar.gz>
     a admssw:SoftwarePackage ;
     dcterms:description "Debian source package files archive for apache2 version 2.2.22−11" ;
     schema:downloadUrl "http://cdn.debian.net/debian/pool/main/a/apache2/apache2_2.2.22−11.debian.tar.gz";
     schema:fileSize "195980" ;
     spdx:checksum [
           a spdx:Checksum ;
           spdx:algorithm <apache2#checksumAlgorithm_md5sum> ;
           spdx:checksumValue "d3d4146ccad51129636b7dbff284a110"
     ] .

#
# Now, we also weave links with the Ubuntu counterparts
#
<https://launchpad.net/ubuntu/+source/apache2>
     a admssw:SoftwareProject ;
     doap:description "\"apache2\" source package in Ubuntu" ;
     # this one promises some trolls and flames
     admssw:forkOf <apache2> ;
     doap:homepage "https://launchpad.net/ubuntu/+source/apache2" ;
     doap:release <https://launchpad.net/ubuntu/+source/apache2/2.2.22−6ubuntu2> .

# and its release known by the PTS
<https://launchpad.net/ubuntu/+source/apache2/2.2.22−6ubuntu2>
     a admssw:SoftwareRelease ;
     rdfs:label "apache2 2.2.22−6ubuntu2" ;
     dcterms:description "\"apache2\" 2.2.22−6ubuntu2 source package in Ubuntu" ;
     doap:revision "2.2.22−6ubuntu2" ;
     admssw:project <https://launchpad.net/ubuntu/+source/apache2> .

4 thoughts on “Generating RDF description of Debian package sources with ADMS.SW”

  1. So I see 647872 triples loaded in in virtuoso.

    Among which :

    – 2096 “names” of packagers (which can be packaging teams).

    – 6693 upstream projects with homepages. Among which 61 from apache.org, so which should have some DOAP RDF descriptions available…

Leave a Reply

Your email address will not be published. Required fields are marked *