5

In the Turtle serialization of an RDF graph, I have many triples like this (many individuals, all with a common value of type):

:A a :b .
:B a :b .
:C a :b .
:D a :b .
# …
:Z a :b .

Is there any way to write this succinctly in Turtle? In SPARQL, which has some similarities to Turtle, we can write:

:b ^a :A, :B, :C, …, :Z .

Is there a counterpart in Turtle?

unor
  • 92,415
  • 26
  • 211
  • 360
Ania David
  • 1,168
  • 1
  • 15
  • 36

1 Answers1

3

No, there isn't a Turtle shortcut for this. See RDF 1.1 Turtle One suggestion is to use one of the many free ontology editors and not have to worry much about reading the text serialization. TopBraid Composer Free and Protégé are good choices, though Protégé is more focused on OWL.

scotthenninger
  • 3,921
  • 1
  • 15
  • 24
  • 1
    This is one of the frustrating things about Turtle. The SPARQL query syntax actually *does* have something for this: the reverse property path. Using it, we can write `:b ^rdf:type :A, :B, :C, :D`. N3 had something like this, too (but I'm not sure it's exactly the same), but it didn't make it into Turtle, I guess. :( – Joshua Taylor Apr 12 '16 at 14:49
  • Property paths are a "path", meaning it's a way to match graph patterns by specifying a set of triple patterns. Specifying triples in text representations via Turtle, JSON-LD, RDF/XML, etc are really a different objective. – scotthenninger Apr 12 '16 at 14:53
  • Yes, arbitrary paths wouldn't make a lot of sense, because what would the intermediate nodes be? But a reverse property would be very helpful in cases like these. – Joshua Taylor Apr 12 '16 at 14:55
  • Even though late: Would be helpful, indeed. The intermediate node would have to be blank nodes, of course. This may be undesirable from an engineering perspective, but very nice from a modelling perspective. – Chiarcos May 16 '22 at 10:04