Issued: 2016-08-31
To cite our work:
Maxime Lefrançois Interopérabilité sémantique libérale pour les services et les objets, Actes de la 17ème conférence Extraction et Gestion des Connaissances, EGC, Jan 2017, Grenoble, France - (PDF - BibTeX)
An RDF graph can be presented in several ways, using different media types. Examples of RDF media types include application/rdf+xml, text/turtle, application/json+ld.
Today, most of the content consumed/produced/published, on the Web is not presented in RDF.
In the Web of Things, HTTP servers and clients would rather exchange lightweight documents, potentially binary. Currently, most existing RDF Presentations generically apply to any RDF graph, at the cost of being heavy text-based documents. Yet, lightweight HTTP servers/clients could be better satisfied with consuming/producing/publishing lightweight documents, may its structure be application-specific.
On the other hand, various formalisms have been developed:
For a given range of RDF graphs and a specific media types, an RDF Presentation is a combination of lifting, lowering, and validation rules. With these rules, one can coherently interpret a representation as RDF (lift), validate the RDF graph, and generate back the representation from the RDF graph (lower).
While sending any kind of document, potentially lightweight, an HTTP server/client may refer to the specific RDF Presentation that is used. Then, the HTTP client/server can lift the document to RDF, and validate it.
Similarly, while requesting for an RDF graph, an HTTP server/client may inform the client/server what representation it prefers. Then, the client/server can validate the RDF graph, then lower it into a document.
Following the Linked Data principles, RDF Presentations are given uniform identifiers (URIs), and an RDF description of these presentations can be retrieved at their URI.
The RDFP vocabulary can be used to describe RDF Presentations and the range of RDF graphs they apply to. It can be accessed at this URI: https://w3id.org/rdfp/ using content negotiation (i.e., set HTTP Header field Accept to one of the RDF syntaxes media types, or access it directly in turtle, or in RDF/XML.
For example, the RDF Presentation identified by https://w3id.org/rdfp/example/graph/xml 303 redirects to https://w3id.org/rdfp/example/description where it is described as follows:
@prefix rdfp: <https://w3id.org/rdfp/>. @base <https://w3id.org/rdfp/>. <example/graph/xml> a rdfp:Presentation ; rdfp:mediaType "application/xml" ; rdfp:liftingRule <example/graph/xml/liftingRule> ; rdfp:loweringRule <example/graph/xml/loweringRule> ; rdfs:isDefinedBy <example/description> .
A full example RDF graph that uses this vocabulary can be found at URI https://w3id.org/rdfp/example/description. Use content negotiation, or access it directly in turtle, or in RDF/XML.
The RDFP vocabulary describes web resources, RDF graphs, ontologies, and their representations.
The URI of a named graph is the identification of that graph in the sense of the W3C Architecture of the World Wide Web, Volume One. The graph is the content, and that graph can be represented by many different documents that can then be exchanged on the Web.
The RDF Presentation qualifies the representation type. Following the general architecture principles defined in W3C Architecture of the World Wide Web, Volume One, we keep orthogonal the identification and representation concepts. Arguably, the representation type (the media type) should be annotated with a link to the RDF Presentation used.
Although new media types could have a parameter that refers to its presentation, such as: application/seas;p="https://w3id.org/rdfp/example/graph/xml". This link cannot be set by a global media type parameter, as per RFC 2045, Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies:
There are NO globally-meaningful parameters that apply to all media types. Truly global mechanisms are best addressed, in the MIME model, by the definition of additional Content-* header fields.
We hence introduce HTTP header field Content-Presentation for this purpose. The value of this field is any absolute URI, that identifies the RDF Presentation of the represented RDF graph.
Using this header properly, any existing server can be adapted to behave “as if” it was producing RDF: the client simply needs to dereference the presentation link, and use the associated lifting rule to interpret the retrieved document as RDF.
Equally important, a lightweight client/server can send lightweight binary messages, while still letting its server/client the chance to interpret the message body as RDF.
RDF Presentation Negotiation is a way for the client to state its presentation preferences for the response message body.
To achieve this, we introduce HTTP header field Accept-Presentation. The value of this field is any (absolute) URI, that identifies the RDF Presentation the clients would like the server to use to encode the response RDF graph.
Using this header properly, a lightweight client can request a compliant server to encode its responses in a specific format, hence transferring all the computation cost on the server.
In some situations, it may seem unreasonable to expect the client/server to:
Hence, in a future version of RDFP, we may introduce additional HTTP header fields to directly refer to these rules. For example:
rdfp-jersey-server is an extension of Jersey that eases the development of RESTful services that produce and consume RDF. It hides the RDF Presentation description and RDF Presentation Negotiation parts, and lets the end developer focus on manipulating RDF graphs as Apache Jena models.
The RDFP vocabulary is used in the following related projects:
rdfp-jersey-server is used in the following related projects:
maxime.lefrancois.86@gmail.com
http://maxime-lefrancois.info/
Label: Graph
IRI: https://w3id.org/rdfp/Graph
Instances of rdfp:Graph are RDF graph resources that may have several representations.
For example,
<https://w3id.org/rdfp/example/input> a rdfp:Graph ; rdfp:describedBy <https://w3id.org/rdfp/example/graph> ; rdfp:representedBy <some_rdfp_resource> .
We propose an alignment of this resource with rdfg:Graph, but this is part of another document.
domain of: describedBy
Label: Graph Description
IRI: https://w3id.org/rdfp/GraphDescription
Instances of rdfp:GraphDescription describe RDF Graphs in terms of validation and presentation.
A rdfp:GraphDescription may be linked to one or more validation rules. A rdfp:GraphDescription may be linked to one or more instances or rdfp:Presentation.
For example,
<https://w3id.org/rdfp/example/graph> a rdfp:GraphDescription ; rdfp:validationRule <some_sparql_ask_rule> ; rdfp:presentedBy <some_presentation_description> .
We propose an alignment of this resource with sd:Graph, but this is part of another document.
Label: Presentation
IRI: https://w3id.org/rdfp/GraphPresentation
Instances of rdfp:GraphPresentation describe RDF Graph presentations in terms of lifting, lowering, and validation rules.
For example,
https://w3id.org/rdfp/example/graph/xml> a rdfp:GraphPresentation ; rdfp:mediaType "application/xml" ; rdfp:liftingRule <https://w3id.org/rdfp/example/graph/xml/lifingRule> ; rdfp:loweringRule <https://w3id.org/rdfp/example/graph/xml/loweringRule> .
Label: Graph Validation Rule
IRI: https://w3id.org/rdfp/GraphValidationRule
The class of graph validation rules resources. Such resources may have various representations:
For example,
<g> a rdfp:GraphDescription ; rdfp:validationRule <v> .
An RDFP engine willing to validate the conformance of a graph G described by <g> with SPARQL ASK queries should follow these steps:
Label: Lifting Rule
IRI: https://w3id.org/rdfp/LiftingRule
The class of rules that enable RDF lifting. Such rules may have various representations, such as a RML mapping, a SPARQL-Generate or a XSPARQL query.
Label: Lowering Rule
IRI: https://w3id.org/rdfp/LoweringRule
The class of rules that enable RDF lowering. Such rules may have various representations, such as a STTL rule.
Label: Representation
IRI: https://w3id.org/rdfp/Representation
The class of web representations. A representation is also a resource.
Label: Representation Validation Rule
IRI: https://w3id.org/rdfp/RepresentationValidationRule
The class of representation validation rules resources. Such resources may have various representations:
Label: Resource
IRI: https://w3id.org/rdfp/Resource
The class of web resources, that have one or several representations.
Label: alias
IRI: https://w3id.org/rdfp/alias
Links a representation to one of its aliases.
According to the Web architecture design principles, there should never be two following rdfp:alias links.
Label: described by
IRI: https://w3id.org/rdfp/describedBy
Links a RDF graph to its description.
Label: lifting rule
IRI: https://w3id.org/rdfp/liftingRule
Links a graph presentation to a resource that enables to lift documents to RDF.
Label: lowering rule
IRI: https://w3id.org/rdfp/loweringRule
Links a graph description to a resource that enables to lower a RDF Graph to a document.
Label: presentation for
IRI: https://w3id.org/rdfp/presentationFor
Links a RDF graph presentation to the description of RDF graphs it may present.
Label: presented by
IRI: https://w3id.org/rdfp/presentedBy
Links a RDF graph description to one of its presentation means.
Label: represented by
IRI: https://w3id.org/rdfp/representedBy
Links a resource to one of its representations. It is expected that the representation has a media type.
Label: validation rule
IRI: https://w3id.org/rdfp/validationRule
Links a graph description (resp. a presentation) to a validation rule against which graphs conforming to this description (resp. representations conforming to this presentation) should validate. Such resources may have various representations.
For example, resource identified by <some_validation_rule> may have a representation as a SPARQL ASK query, as a ShEx expression, or as a SHACL shape.
Label: media type
IRI: https://w3id.org/rdfp/mediaType
Links a representation to its media type.