Questions tagged [rdf]

The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web. It is a syntax independent data model that may be serialised in a variety of concrete syntaxes. RDF is the core data format used on the Semantic Web.

The Resource Description Framework (RDF) is a language for representing information about resources in the World Wide Web. It is a syntax independent data model that may be serialised in a variety of concrete syntaxes. RDF is the core data format used on the Semantic Web.

Data Model

The data model for RDF is Graph based. Every fact in the data is represented as a Triple (or Statement) composed of a Subject, Predicate and Object. The Subject and Object can be thought of as nodes in the Graph while the Predicate is an arc in the Graph. Graphs are composed of a set of Triples, note that duplicates have no meaning.

Subjects must be resources which can either be named (using a IRI) or anonymous (known as Blank Nodes). IRIs are considered to be globally scoped while Blank Nodes are scoped to the Graph in which they appear.

Predicates must always be named resources i.e. IRIs.

Objects may be resources - IRIs/Blank Nodes - or they may be Literal values. Literal values are of three types:

  1. Simple Literals - These are just strings e.g. "simple literal"
  2. Literals with Language Specifiers - These are strings with the language of strings specified using standard language tags e.g. "literal with language tag"@en-gb
  3. Literals with DataTypes - These are values with a declared data type e.g. "123"^^xsd:integer . XML Schema DataTypes are commonly used and supported by related standards like SPARQL

Syntaxes

RDF is a syntax independent model but has a variety of officially and semi-officially standardised concrete syntaxes which are used to serialise it.

Official Standards (W3C)

The following are official standards created by the W3C

  • RDF/XML is the official XML based serialisation of RDF. RDF/XML is quite commonly used but has some drawbacks in being difficult for a human to understand or write by hand.
  • NTriples is the official plain text format for serialising RDF. It is a very simple serialisation that uses no syntactic sugar, it is very quick to parse and can be read/written by hand. It's disadvantage is that it is very verbose compared to other syntaxes.
  • RDFa is the officially recommended mechanism for embedding RDF into existing (X)HTML web pages. It is easy to use once learned but is sometimes criticised for the fact that the DOM structures required to embed RDFa often don't fit with the DOM structures of pages forcing developers to embed additional hidden elements with the RDFa.
  • Turtle is a readable yet compact plain text serialisation of RDF developed by Dave Beckett who was one of the members of the W3C working group that created the RDF specifications. It is quick and easy to parse and includes various syntactic sugar for compressing the data to make it less verbose. Turtle is a superset of NTriples and a subset of Notation 3 Turtle was introduces as an official RDF serialization in February 2014.
  • JSON-LD - JSON-LD is another JSON serialisation of RDF. It emphasises compact syntax and the ability to add RDF into your existing JSON data. It becamse official along with Turtle in February 2014.

Unofficial Standards

While the following are not officially standardised they are reasonably well specified and are widely implemented in RDF/Semantic Web APIs:

  • Notation 3 is a readable yet compact plain text serialisation of RDF developed by Tim Berners-Lee. It is a superset of Turtle and is capable of expressing data which is outside of the core RDF model as well as expressing all valid RDF.
  • Talis RDF/JSON - One of several competing JSON serialisations of RDF that tries to be as compact as possible

Resources

4248 questions
12
votes
3 answers

Performance comparison of RDF storage vs traditional database

Has someone experiment RDF storage solution like Sesame? I'm looking for performance review of this kind of solution compared to the traditional database solution.
Nicolas
  • 24,509
  • 5
  • 60
  • 66
12
votes
5 answers

SPARQL Negation: All foaf:Agents which aren't foaf:Persons

I am trying to write a SPARQL query which should give me all foaf:Agents which aren't foaf:Persons. I can't see a way to apply this OPTIONAL/BOUND construct to this problem, because all the properties like rdfs:subClassOf and rdf:type are transitive…
Juri Glass
  • 88,173
  • 8
  • 33
  • 46
12
votes
2 answers

RDF and microdata future

What should we expect from RDF and microdata in the future? Is microdata able to completely replace RDF, is this the goal? Or are they meant to exist side by side? Should we have both on our sites once microdata becomes more famous? Update: I did…
Unknown
  • 1,377
  • 1
  • 15
  • 33
11
votes
2 answers

Any configuration management software using RDF?

Do any configuration management software (such as Puppet, Chef, Pallet, SmartFrog, etc.), open or closed source, using RDF data model to describe and configure infrastructure and software running on it? Alternatively, is there an RDF vocabulary or…
castagna
  • 1,349
  • 10
  • 12
11
votes
1 answer

Retrieving a DBpedia resource by its string name with SPARQL and without knowing its type

As shown in this question which has a similar title, I would like to retrieve a dbpedia resource by knowing a part of its name. I'm a beginner when it comes to SPARQL and such, but the example in the question helped me a lot, as the author searched…
Ged ort
  • 113
  • 1
  • 5
11
votes
2 answers

SPARQL Querying Transitive

I am a beginner to SPARQL and was wondering if there was a query which could help me return transitive relations. For example the n3 file below I would want a query that would return "a is the sameas c" or something along those lines. Thanks…
Sam
  • 1,479
  • 3
  • 14
  • 16
11
votes
3 answers

Java n-triple RDF parsing

I want to parse an RDF file which is in n-triple form. I can write my own parser but I would rather use a library, and Jena seems unecessarily complicated for this purpose (or at least I can't see their docs explaining how to read n-triples in a…
Ankur
  • 50,282
  • 110
  • 242
  • 312
11
votes
2 answers

What does "reify" and "reification" mean in relation to RDF?

I do think I understand the meaning of these words in programming languages, but it is not clear in regards to RDF and triples. Is there an example that will help me to understand? Thank you
Eli Schneider
  • 4,903
  • 3
  • 28
  • 50
11
votes
5 answers

Any alternatives to Virtuoso as a graph store?

I like it (very much) that is supports SPARQL/Update and the SPARQL endpoint that comes with it, but I'm a little worried about vendor lock in I think it is overkill for my requirements (I want a graph store with half a billion triples) I would…
Ashkan Kh. Nazary
  • 21,844
  • 13
  • 44
  • 68
11
votes
2 answers

SPARQL Type Conversion?

I have the following SPARQL query: PREFIX ssn: PREFIX dtp: PREFIX dbp: SELECT ?value ?time WHERE { dtp:CD7514 ssn:madeObservation…
Bailz
  • 605
  • 2
  • 8
  • 17
11
votes
1 answer

What does slash mean in a SPARQL property path?

In one of the samples for querying Wikidata, I found the following query, which includes p:P6/v:P6 in the line after SELECT. What does it mean? PREFIX wd: PREFIX wdt: PREFIX…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
11
votes
9 answers

Which Triplestore for rapid semantic web development?

Ease of installation/use is the most important factor here - not performance. Small is OK as large datasets are not expected.
Stephen
  • 1,215
  • 2
  • 25
  • 40
11
votes
2 answers

Apache Jena vs Apache Marmotta

What's the difference between Apache Jena and Apache Marmotta? According to my readings both can be used for semantic web purposes. Both supports RDF,Triple store and so on. Both are based on Java. I hope this question will be valuable for those…
Techie
  • 44,706
  • 42
  • 157
  • 243
11
votes
1 answer

Extracting (subject,predicate,object) from dependency tree

I'm interested in extracting triples (subject,predicate,object) from questions. For example, I would like to transform the following question : Who is the wife of the president of the USA? to : (x,isWifeOf,y) ∧ (y,isPresidentof,USA) x…
11
votes
2 answers

Meaning of square brackets "[]" when querying RDF with SPARQL?

I am pretty new to SPARQL and RDF and I was wondering what exactly does the below mean in SPARQL? [] vc:n ?vcard . The complete query is PREFIX vc: SELECT ?given ?family WHERE{ [] vc:n ?vcard . …
Nitish Mathur
  • 113
  • 1
  • 6