Although there's definitely a place for up-front schema design,
while coding it's often convenient to leave such stuff open,
subject to change as the code informs. RDF instance data still
makes a lot of (semantic) sense without having a schema/ontology,
so this can be deferred indefinitely...
Sometime soon I'm going to need a RESTful web service
description language and an access control/authentication language
(note to self: remember to check what
KnoBot does
for these - is there an ESW page for the latter yet?)
Of the
WebDescriptionProposals,
Ian Davis'
WAIF
looks the best fit for what I need, not least because it's already
RDF-friendly. From his write-up there's everything needed to put
manually put together a schema/ontology
(hmm, the parameters stuff looks like it might be expressable
pretty richly with OWL cardinality). But I think there's
enough info in his instance examples to automatically build the
skeleton of a schema - which is all I need in the near future (to
use with Jena's schemagen, that autogenerates Java source
corresponding to classes & properties).
Has anyone set something up for this yet? For Jena? If not I'll
add it to my to-do, shouldn't take long at all (and could actually
make a handy online service, giving me another use case...)
Here's how I imagine it working:
- RDF model is loaded with all available instance data
- RDFS/OWL inference appliedÂ
- Statements matchingÂ
{?c rdf:type rdfs:Class},
{?p rdf:type rdf:Property},
{?p rdfs:domain ?d} etc extracted
(and/or corresponding OWL terms)
- Statements annotating the classes and properties
extracted
- Skeleton schema serialised outÂ
I'm not 100% sure about 4 (which in practice would be part of
3), I think
{?c ?p o?},
{?p ?p 2 o?} might do the trick. For
those cases, and in general, it would be necessary to filter out
any statements involving a bnode (assuming there were some
inferred).Â
The extraction could be done in the main code, but could be
sweeter done as a SPARQL query.Â
The resulting schema would be missing things like special
(individual) resource, and I doubt much OWLishness could be
reliably extracted. But still it could be a good timesaver.
Heh, could probably have coded it in the time it taken to write
this, but I'm meant to be working...
@en