[doap-interest] advice on how to change code parsing doap files
Thomas Vander Stichele
thomas at apestaart.org
Sat Apr 25 11:08:05 CEST 2009
Hi,
in my code (MOAP) I parse a .doap file and create the various objects
from the .doap file.
Someone said he preferred my code to error out if a <Version> section
was missing required information, and I agree with him. Right now it
just silently skips it.
It does so because I have this SPARQL query in my code:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?projectId, ?name, ?branch, ?revision, ?created, ?description
WHERE {
?project rdf:type doap:Project .
?project doap:shortname ?projectId .
?project doap:release ?release .
?release doap:name ?name .
?release doap:branch ?branch .
?release doap:revision ?revision .
?release doap:created ?created
OPTIONAL { ?release dc:description ?description }
}
ORDER BY DESC(?created)
My first instinct was to move all of the release-related WHERE sections
into an OPTIONAL, but then I stopped and thought:
"shouldn't the point of describing the syntax of doap allow me to
validate any .doap file in the first place" ?
So, since you're all much more expert than me, please tell me:
- what would be the right approach to validate any .doap file against
required arguments for all its sections
- how would I do this using redland (and its python bindings) ?
- how can it be avoided to do a web lookup every time for the syntax
files ?
Thanks
Thomas
--
Ik heb vannacht gedronken en gezien
Hoe jij van mij nooit krijgt wat je verdient
--
URGent, best radio on the net - 24/7 !
http://urgent.fm/
More information about the doap-interest
mailing list