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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With