7

I've got one (maybe) simple question: Can I assign more than one ObjectResource to a fixed Subject-Property Statement?

I want my RDF-Triples look like that:

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/New_York_Times]

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/The_Guardian]

[http://somewhere/Angela_Merkel, http://somewhere/properties#isMentionedIn, http://somewhere/BildZeitung]

and so on.. Is this rdf well-formed?

And can I implement this in Apache Jena?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
malwin
  • 652
  • 7
  • 18
  • The format that you've got is actually very close to N-Triples already. Writing as ` .` you'd have legal N-Triples format, and you could actually test whether the RDF can be loaded. – Joshua Taylor Sep 15 '16 at 13:46

1 Answers1

6

Yes this would be well formed data and it is a common way to define multiple values for a given property on a given subject.

RDF has very few restrictions on what triples you can declare. Essentially these boil down to the following:

  • The subject must be a IRI/blank node
  • The predicate must be a IRI
  • The object may be a IRI/blank node/literal
  • Duplicate triples are ignored i.e. Declaring the same triple multiple times is the same as declaring it once

IRIs are a superset of URIs - see RFC 3987 for more details. TL;DR IRIs are basically URIs with a wider permitted character set to allow internationalised identifiers

Beyond that you are free to declare as many triples as you want.

You can certainly implement this with Apache Jena, I would suggest starting with the Introduction Tutorial and asking new more specific questions if you get stuck.

Community
  • 1
  • 1
RobV
  • 28,022
  • 11
  • 77
  • 119
  • Thank you very much. Yeah, i looked through some Introductions, but i became a little nervous, so i asked. Cheers, FFoDWindow. – malwin Sep 15 '16 at 11:56
  • 1
    [The spec](https://www.w3.org/TR/rdf11-concepts/) says IRI instead of URI. The space of possible IRIs is a superset of the space of possible URIs. – Stuporman Mar 07 '21 at 00:28