huwd / learning-ttl

Huw's attempts to tech himself Turtle
0 stars 0 forks source link

Is it OK to just keep adding triples that reference multiple vocabularies? #3

Open huwd opened 2 years ago

huwd commented 2 years ago

https://github.com/huwd/learning-ttl/blob/7de53e16839f3beb99e506b2d4739ddcef1a4bae/refactor.ttl#L113

I've represented this book as a schema.org book:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> .
@prefix books: <https://www.huwdiprose.co.uk/books/> .
@prefix book: <https://www.huwdiprose.co.uk/book/> .
@prefix schema: <https://schema.org> .

books:life_on_earth a schema:Audiobook ;
 book:name "Life on Earth" ;
 book:readBy "David Attenborough" ;
 book:author "David Attenborough" ;
 book:publisher "HarperCollins Publishers Limited" ;
 book:datePublished "2020-12-23" ;
 book:abridged "false" .

but there's also bibo

Can I just keep adding triples here, even from multiple vocabularies? I can't see a problem with it...

So I'd add:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> .
@prefix books: <https://www.huwdiprose.co.uk/books/> .
@prefix book: <https://www.huwdiprose.co.uk/book/> .
@prefix schema: <https://schema.org> .
@prefix bibo:<http://purl.org/ontology/bibo/> .

books:life_on_earth a schema:Audiobook ;
 book:name "Life on Earth" ;
 book:readBy "David Attenborough" ;
 book:author "David Attenborough" ;
 bibo:authorList "David Attenborough" ; # <- not sure how a list is represented but you get the drift
 book:publisher "HarperCollins Publishers Limited" ;
 book:datePublished "2020-12-23" ;
 book:abridged "false" .
pmcb55 commented 2 years ago

Well, first, you've represented this as a schema:Audiobook as opposed to schema:Book (was that intentionally more 'narrow')?

But the main question - yes, it's totally fine to use multiple vocabs - and in this particular case, I'd definitely type this instance of a book as both schema:Book/Audiobook and bibo:Book (or bibo:AudioDocument). I say that because BIBO is a widely used and 'respected' vocabulary (as far as I know, anyways), and by typing with both very common vocabs, you improve ease-of-interop generally.

The question of how to represent 'lists' is a completely separate topic, but it appears BIBO uses the 'out-of-the-box' RDF approach (i.e., rdf:first and rdf:rest).