Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut for creating a class in N3/Turtle ontology language

Here is how I know to create a class in N3:

:Person a rdfs:Class.

And here is how to specify that a specific ressource is an instance of that class:

:Pat a :Person.

Problem: I want to create a class with more than 20000 instances (programmatically generated). Writing the whole :Pat a :Person. for my 20000 instances makes the ontology file verbose.

Question: is there a work around to make the file smaller?

like image 902
user14750 Avatar asked Aug 29 '12 00:08

user14750


1 Answers

If you are really using N3 and not Turtle (which I doubt), you can use the @is ... @of keywords, like this:

:Person  a  rdfs:Class;
    @is a @of  :Pat, :Bob, :Chris, :Cindy, :Suzy .

There are hardly any Turtle toolkit that allow this.

There was also a long discussion thread on the [email protected] Mail Archives about adding this functionality to Turtle (which is currently published by the W3C as a Last Call Working Draft), starting with a comment by Tim Berners-Lee. Then went a comment by Dave Beckett asking for not including the feature, and a long thread again. Then went a good summary of the positions with a comment by Gavin Carothers, editor of the Turtle spec in the current RDF Working Group.

However, I doubt this will become a feature of Turtle when it's eventually standardised.

BTW, what's the problem of having 20,000 records when it's all generated (and I guess, parsed) programmatically? If you need to exchange so much data over the network, you can easily compress it a lot. Or, you could use a compact serialisation syntax like HDT, but there are few implementations.

like image 140
Antoine Zimmermann Avatar answered Sep 22 '22 09:09

Antoine Zimmermann