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
2
votes
1 answer

Exception when I want to load model with jena

I am working with jena library. When I want to open this address: model = FileManager.get().loadModel("http://dbpedia.org/resource/Shlomo_Breznitz"); I got this exception: http://dbpedia.org/resource/Shlomo_Breznitz(line 54 column 8): Element or…
hudi
  • 15,555
  • 47
  • 142
  • 246
2
votes
3 answers

Parsing nested XML/RDF namespace elements in PHP with SimpleXML

Given the XML/RDF example below taken from the W3C website, how can I access the values in the "cd" namespace?
Bendihossan
  • 2,407
  • 5
  • 22
  • 25
2
votes
3 answers

extract information from xml file as RDF triples

Could any one please recommend a tutorial or tell me how can I build a java program for extracting information from xml files and produce the out put as RDF triples using an existing ontology. an example would be really helpful. Thanks
Lucy
  • 471
  • 4
  • 12
  • 28
2
votes
1 answer

About the subject predicate object triplet in RDF

I have a question regaring writing triplets in RDF. According to the description http://www.w3.org/TR/rdf-concepts/#section-triples, it's been said that a predicate should be an URI. But lets say if I want to write something like…
rajan sthapit
  • 4,194
  • 10
  • 42
  • 66
1
vote
1 answer

MDN Extension not working

I'm trying to install an add-on but it says onextension could not be installed because it's not compatible with Firefox 11 but it is (I wrote it). Here's the install.rdf
Luis
  • 1,067
  • 1
  • 14
  • 25
1
vote
2 answers

A pair of attributes in RDF

How do you specify a pair (or more) of attributes for an entity in RDF without losing the connection? (Sorry, I am a newbie.) For example, I would like to say a GPS has a reading of latitude and longitude, but I want to specify something like 'GPS…
Rolonoa
  • 83
  • 6
1
vote
1 answer

Columns and rows in SPARQL query result

I have a problem here, it looks easy but because I am not really familiar with Sparal queries I could not find a solution for it. PREFIX onto: PREFIX resu: PREFIX yago:…
MR BIG
  • 163
  • 1
  • 1
  • 6
1
vote
1 answer

Where to download xsd about sparql protocol for rdf

I want to write web service for sparql enpoint so I need wsdl and xsd. Here: http://www.w3.org/TR/sprot11/ I read that wsdl can be download from adress http://www.w3.org/TR/sprot11/sparql-protocol-query-11.wsdl but these wsdl import xsd which doesnt…
hudi
  • 15,555
  • 47
  • 142
  • 246
1
vote
1 answer

Device Description Vocabulary

I asked a more general question a while back and didn't get any responses but am still going to persevere. Does anyone know of a vocabulary/ontology for describe digital devices with web browsers? I am talking about something in RDF (RDFS or OWL). I…
William Greenly
  • 3,914
  • 20
  • 18
1
vote
3 answers

Why does this SPARQL query return a title?

I was looking for a SPARQL tutorial, but all I found was just queries and results - no descriptions. For example: • Data: "SPARQL Tutorial" . • Query: SELECT ?title WHERE {…
hudi
  • 15,555
  • 47
  • 142
  • 246
1
vote
1 answer

Using RDFa meta property with facebook's XHP

I'm playing with xhp and I got stuck on this: echo ; It throws: Fatal error: Uncaught exception 'XHPAttributeNotSupportedException' with message 'Attribute `property` is not supported in class…
Tad Lispy
  • 2,806
  • 3
  • 30
  • 31
1
vote
1 answer

Extract properties associated with classes from RDF file

I have written my code to extract classes and Subclasses from my RDF file.. This is the code.. I am using dotNetRDf library.. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System; using…
pitumalkani
  • 127
  • 1
  • 1
  • 7
1
vote
2 answers

How would RDF, N3, 3stores, and SPARQL handle an additional timestamp field?

I want to build a queryable RDF database of events of the form: :Bob :played :musiccd :at "00:00:00 UTC on 1 January 1970" Is this possible with RDF/N3/3store/SPARQL? Does SPARQL know how to compare datetimes and test for membership in datetime…
mcandre
  • 22,868
  • 20
  • 88
  • 147
1
vote
1 answer

Check whether the property is functional using SPARQL query

I want to check whether a property is functional or not. I tried: ASK { pz:isBase owl:isInverseFunctional . } but it is a syntax error. How can I check whether a property is functional?
umar
  • 910
  • 10
  • 24
1
vote
1 answer

In RDFa is it legal to use the @rev with @property

In the following snippet of RDFa: the URI in the about= attribute is the subject (OK the entity referred to by the URI, but you get the idea), rel…
GrantRobertson
  • 460
  • 3
  • 15
1 2 3
99
100