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
13
votes
6 answers

Triplestore for Large Datasets

I want to ask about a good triplestore to use for large datasets, it should: Scale well (millions of triples) Have a Java interface
myahya
  • 3,079
  • 7
  • 38
  • 51
13
votes
6 answers

Recommended RDF IDE/Editor?

I've done a bit of searching around for a good RDF editor. But I'm not sure what one is the most utilised. Can anyone recommend one? I'm looking to write some simple RDF and maybe parse one or two RDF documents. Many thanks
Joeblackdev
  • 7,217
  • 24
  • 69
  • 106
13
votes
4 answers

OWL Property Restrictions vs. SHACL

Given a choice between OWL Property Restrictions and SHACL, is there any reason to choose the OWL approach any more? Particularly with respect to cardinality constraints, I'm wondering whether SHACL is considered to supercede OWL. The syntax appears…
jaco0646
  • 15,303
  • 7
  • 59
  • 83
13
votes
1 answer

Representing Natural Language as RDF

How much of the concepts conveyed in natural language is RDF/OWL able to represent? I'm still learning RDF and other semantic technologies, but as I currently understand it, information is typically represented as triples of the form…
Cerin
  • 60,957
  • 96
  • 316
  • 522
13
votes
1 answer

DISTINCT only on one value with SPARQL

I want to retrieve with SPARQL the list of the italian cities with more than 100k of population and I'm using the following query: PREFIX dbo: SELECT ?city ?name ?pop WHERE { ?city a dbo:Settlement . ?city…
drstein
  • 1,113
  • 1
  • 10
  • 24
13
votes
1 answer

Difference between Json, XML and RDF

I have a doubt about what are the differences between JSON, XML and RDF. I read on the internet: JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse…
Neptune
  • 607
  • 2
  • 8
  • 19
13
votes
5 answers

what is the advantage of RDF and Triple Storage to Neo4j?

Neo4j is a really fast and scalable graph database, it seems that it can be used on business projects and it is free, too! At the same time, there are no RDF triple stores that work well with large data or deliver a high-speed access. And what is…
Wang Ruiqi
  • 804
  • 6
  • 19
12
votes
3 answers

How to recursively expand blank nodes in SPARQL construct query?

There is probably an easy to answer to this, but I can't even figure out how to formulate the Google query to find it. I'm writing SPARQL construct queries against a dataset that includes blank nodes. So if I do a query like CONSTRUCT {?x ?y ?z…
rogueleaderr
  • 4,671
  • 2
  • 33
  • 40
12
votes
3 answers

can we use owl:SameAs between two predicates?

What is the difference between using and Here NS is some namespace.
kunal
  • 175
  • 1
  • 13
12
votes
1 answer

Querying DBpedia for English-only description (with SPARQL)

I'm querying dbpedia.org for a description of Big Ben with this SPARQL query: select ?desc where { ?desc } This returns a list of descriptions in at least 10…
siamii
  • 23,374
  • 28
  • 93
  • 143
12
votes
2 answers

Can RDF model a labeled property graph with edge properties?

I wanted to model partner relationship like the following, which I expressed in the format of labeled property graph. I wanted to use RDF language to express the above graph, particularly I wanted to understand if I can express the label of the…
chen
  • 4,302
  • 6
  • 41
  • 70
12
votes
2 answers

Downloading GeoJSON boundaries using SPARQL from publicly available data

I'm interested in downloading some boundary files from statistics.gov.scot, which is an official statistical repository for sharing statistical data that utilises SPARQL queries. Background Statistics.gov.scot provides access to GeoJSON boundaries…
Konrad
  • 17,740
  • 16
  • 106
  • 167
12
votes
1 answer

How to handle case-insensitive SPARQL data in MarkLogic

I'm trying to understand how best to handle literals in Marklogic SPARQL data which may be in any case. I'd like to be able to do a case insensitive search but I believe that isn't possible with semantic queries. For a simplistic example I want:…
Millstone1998
  • 150
  • 1
  • 8
12
votes
2 answers

Defining DataRange Expression in Protege for a Data Type Property

I am adding few new DataType in the OWL using Protege. The DataType is like percentage and I want to specify it's range with the double value ranging from 0 to 100. Similarly a DataType named Quality and I want to specify it's range with the double…
Gaurav
  • 531
  • 1
  • 4
  • 15
12
votes
1 answer

How to query Classes with Object Property in Sparql

Does any one know how to query Classes with Object Property in Sparql? Assume we have an OWL file which contains follows Human ----(hasPizza)---> Pizzas Human and Pizzas are classes (or concepts). In SPARQL, this query returns nothing: select ?x ?y…
user2334508
  • 303
  • 1
  • 3
  • 11