Unofficial Draft
Copyright © 2024 the document editors/authors. Text is available under the Creative Commons Attribution 4.0 International Public License; additional terms may apply.
In [RML-IO] source and target access descriptions are complemented with external (existing or custom) vocabulary.
The [RML-IO] specification includes several examples of modelling access to web resources with an external vocabulary (DCAT dataset, SPARQL endpoint, WoT...). Because the [RML-IO] specification only includes examples, it does not specify the expected shape per access description or other guidelines to secure an unambiguous implementation by RML processors.
This specification specifies an access description to a web resource, modelled as a simplified HTTP request with optional authentication. The configuration options are intentionally minimized to secure a straightforward implementation by RML processors.
This specification is use-case driven. It was developed to support to access to resources on a Solid pod [Solid], but supports also access to other web resources without having the ambition to cover all cases. It can be extended to cover other use cases, e.g., with additional authentication descriptions.
This section is non-normative.
We assume readers have basic familiarity with [RDF] and [RML] concepts.
In this document, examples assume the following namespace prefix bindings unless otherwise stated:
Prefix | Namespace |
---|---|
rml: |
http://w3id.org/rml/ |
rmle: |
https://rml.io/ns/extensions# |
htv: |
http://www.w3.org/2011/http# |
formats: |
https://www.w3.org/ns/formats/ |
ex: |
http://example.org/ |
foaf: |
http://xmlns.com/foaf/0.1/ |
The examples are contained in color-coded boxes. We use the Turtle syntax [Turtle] to write RDF.
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MUST and MUST NOT in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
This specification describes the [RML-IO] access to a web resource, modelled as a simplified HTTP request with optional authentication. The configuration of the HTTP request is restricted to the properties defined in this specification, to limit the needed implementation by an RML processor.
The specification reuses the HTTP Vocabulary in RDF 1.0, defines defaults and adds custom vocabulary for access to auxiliary resources and for authentication.
The access description complements the description of a source (rml:source
) or a target (rml:target
).
An HTTP request (rmle:HttpRequest
) an abstract construct describing how a web resource must be accessed by an RML processor, both for source and target.
A HTTP request is a subclass of a request (htv:Request
) as specified in the HTTP Vocabulary in RDF 1.0, represented by a resource that MUST contain:
htv:methodName
), whose value is a literal denoting the HTTP method name,rmle:userAuthentication
), whose value is an user authentication,rmle:acceptHeader
), whose value is a literal denoting the value for the Accept` header,rmle:contentTypeHeader
), whose value is a literal denoting the value for the Content-Type header.The accept header and the content-type header properties are shortcuts for the nested header description in HTTP Vocabulary in RDF 1.0, as exemplified below.
<#request1> rmle:acceptHeader "text/plain".
# is a shortcut for
<#request1> htv:headers [
a htv:RequestHeader ;
htv:fieldName "Accept" ;
htv:fieldValue "text/plain" ;
htv:hdrName <http://www.w3.org/2011/http-headers#accept> ;
] .
<#request2> rmle:contentTypeHeader "text/turtle".
# is a shortcut for
<#request2> htv:headers [
a htv:RequestHeader ;
htv:fieldName "Content-type" ;
htv:fieldValue "text/turtle" ;
htv:hdrName <http://www.w3.org/2011/http-headers#content-type> ;
] .
When the HTTP request complements the description of a source, the body of the response after its execution contains the data for the source.
If unspecified, the method name is by default "GET"
.
If unspecified, the accept header is by default derived from the reference formulation (rml:referenceFormulation
) of the logical source (rml:LogicalSource
) in which it is contained, following the table below:
reference formulation | accept header |
---|---|
rml:CSV |
text/plain |
rml:JSONPath |
application/json |
rml:XPath |
application/xml |
rml:XPathReferenceFormulation |
application/xml |
formats:SPARQL_Results_CSV |
text/plain |
formats:SPARQL_Results_TSV |
text/plain |
formats:SPARQL_Results_JSON |
application/json |
formats:SPARQL_Results_XML |
application/xml |
When the HTTP request is used to complement the description of a target, the body of the HTTP request contains the generated RDF.
If unspecified, the method name is by default "PUT"
.
If unspecified, the content-type header is by default derived from the serialization format (rml:serialization
) of the logical target (rml:LogicalTarget
) in which it is contained, following the table below:
serialization format | content-type header |
---|---|
formats:N-Triples |
application/n-triples |
formats:Turtle |
text/turtle |
formats:JSON-LD |
application/ld+json |
formats:TriG |
application/trig |
formats:N-Quads |
application/n-quads |
A direct HTTP request (rmle:DirectHttpRequest
) is an HTTP request (rmle:HttpRequest
) that MUST contain:
htv:absoluteURI
), whose value is a literal denoting the absolute URI to access the resource.In the example below generated RDF triples are exported using an HTTP PUT
request to URI https://mypod/persons, with the generated RDF triples as body and with application/n-triples
as content-type.
A linked HTTP request (rmle:LinkedHttpRequest
) describes how to access a web resource linked from another web resource,
via the HTTP Link header with a specified relation.
We refer to the web resource that links to that linked web resource as linking web resource.
One use case for a linked HTTP request is access to ACL resources. Clients discover the ACL resource associated with a resource by making an HTTP request on the URI of the linking web resource to which the ACL resource applies. The URI of the ACL resource is exposed with relation acl
in the HTTP Link header.
A linked HTTP request is an HTTP request (rmle:HttpRequest
) that MUST contain:
rmle:linkingAbsoluteURI
), whose value is a literal denoting the absolute URI of the linking web resource.rmle:linkRelation
), whose value is a literal denoting the link relation.A linked HTTP request MUST NOT contain an explicit absolute URI property (htv:absoluteURI
).
The absolute URI is by default discovered by making an HTTP HEAD
request on the linking web resource absolute URI, and checking the HTTP Link header whose relation property equals the specified link relation.
The following example shows a Solid ACL target that exports RDF triples to an ACL file for a linking web resource with URI https://mypod/persons.
In the example below, the absolute URI for the linked HTTP request is discovered by making an HTTP HEAD
request on https://mypod/persons, and extracting the value of the HTTP Link header with relation acl
. The generated RDF triples are exported using a HTTP PUT
request to the discovered URI, with the generated RDF triples as body and with text/turtle
as content-type.
A resource of the type user authentication (rmle:UserAuthentication
) describes authentication details. The required authentication information depends on the authentication type.
This terminology is aligned with the International Data Spaces Information Model.
This specification specifies following types of user authentication:
rmle:CssClientCredentialsAuthentication
), describing the information required for authentication using client credentials as specified in the documentation of the Solid Community Server version v7.A CSS client credentials authentication is represented by a resource that MUST contain:
rmle:authEmail
), whose value is a string denoting the email for the authentication.rmle:authPassword
), whose value is a string denoting the password for the authentication.rmle:authWebId
), whose value is named node denoting the webID for the authentication.rmle:authOidcIssuer
), whose value is a named node denoting the OpenID Connect issuer for the authentication.In this example the content of a web resource are used as source data. The generate RDF triples are exported resp. to a Solid resource with URI https://mypod/profile/persons and to the ACL resource linked to this resource. User you gets read access to https://mypod/profile/persons, the owner of the POD, i.e., me, gets read, write, and control access. It is important that the owner rights are added, because the ACL resources (and consequently any existing access rights) are overwritten.
Referenced in: