w3c / rdf-star

RDF-star specification
https://w3c.github.io/rdf-star/
Other
118 stars 23 forks source link

deeply nested triples or blank nodes? #272

Open valecarriero opened 1 year ago

valecarriero commented 1 year ago

Hi there,

I am new to rdf-star, and I would like to have your feedback about a use case I have, where I'm trying to write "deeply nested triples".

I use the vocabulary owl-star, for annotating the probability of owl axioms represented as single triples, and I believe I'm trying to address the problem already described in this issue by the author of the vocabulary. This is what I wrote in turtle-star:

@prefix wd: <http://www.wikidata.org/entity/> .
@prefix wdt: <http://www.wikidata.org/prop/direct/> .
@prefix os: <http://w3id.org/owlstar/> .

<< << wd:Q18127 wdt:P17 wd:Q35120 >> os:interpretation os:AllSomeInterpretation . >> os:frequentistProbability "86.04%" .

So, my question is: is this correct? If so, the problem is already solved (I can have another deeply nested triple like this one with no problems << << wd:Q18127 wdt:P17 wd:Q35120 >> os:interpretation os:AllOnlyInterpretation . >> os:frequentistProbability "77%" .

I am asking also because I found this tool for visualizing turtle-star code, but it gives me an error with the previous piece of code.

Instead, the "blank node solution" (see the code below), as described here, works with this visualization tool. But I would prefer not to go for blank nodes, if the first one is correct.

@prefix wd: <http://www.wikidata.org/entity/> .
@prefix wdt: <http://www.wikidata.org/prop/direct/> .
@prefix wikibase: <http://wikiba.se/ontology#> .
@prefix os: <http://w3id.org/owlstar/> .
@prefix ex: <http://example.org/> .

<< wd:Q18127 wdt:P17 wd:Q35120 >> ex:occurrences _:Q18127_P17_Q35120_AllSome .
_:Q18127_P17_Q35120_AllSome os:interpretation os:AllSomeInterpretation ; os:frequentistProbability "99.88%" .

<< wd:Q5 wdt:P21 wd:Q4369513 >> ex:occurrences _:Q18127_P17_Q35120_AllOnly .
_:Q18127_P17_Q35120_AllOnly os:interpretation os:AllSomeInterpretation ; os:frequentistProbability "77%" .

Thanks a lot in advance, Valentina

TallTed commented 1 year ago

Note that RDF-star (which was initially written up as RDF*, but that name is very problematic, and has been set aside) is far from finalized, so everything you're working with should be considered experimental, at best. Along these lines, note that OWLStar was last changed in February 2021, more than a year before the final report was issued by the RDF-star focus group of the RDF-DEV Community Group.

According to current RDF-star draft spec, you can nest triples, as in your first example. The :isSemantic visualizer appears to need some updates, given that it chokes on that example data. (I also note that they refer to both RDF* and RDF-star, treating these names as synonyms, but as I noted above, that is not the case.)

I do not think you will need to take the "blank node" route you describe — but that depends on the tools you use accepting the nested route.

valecarriero commented 1 year ago

Thank you so much for your useful feedback, @TallTed! Valentina