RDF source

The RDF data source is able to read RDF data in N-Triples, Turtle, N3 or RDF/XML format and turn this into entities.

See the Working with RDF document for more detail on working with RDF in Sesam.

It will transform triples on the form <subject-uri> <predicate-uri> "value" OR <object-uri> into entities on the form:

{
    "_id": "<subject-uri>",
    "<predicate-uri>": "value" OR "~robject-uri"
}

RDF Blank Nodes (aka BNodes) will be turned into child entities.

Prototype

{
   "type": "rdf",
   "system": "url--or-microservice-system-id",
   "url": "url-to-rdf-file",
   "sort_lists": true,
   "format": "nt-ttl-or-xml"
}

Properties

Property

Type

Description

Default

Req

system

String

The ID of the URL system or microservice system component to use.

Yes

url

String

The URL of the RDF file to load - it can contain multiple subjects (with blank node hierarchies) and each unique non-blank subject will result in a single root entity.

Yes

format

String

The type of RDF file referenced by the url property. It is an enumeration that can take following recognized values: "nt" for N-Triples, "ttl" for Turtle, "n3" for N3 or "xml" for RDF/XML files.

“nt”

sort_lists

Boolean

If the sort_lists is set to true any resulting entity properties containing lists of values (due to them having the same RDF predicate) will be sorted, making the output predictable. This applies in a recursive fashion.

true

is_sorted

Boolean

Indicates that the input data is sorted on RDF subject. If the is_sorted is set to true and the format property is nt (N-Triples), the RDF source will attempt to parse the input data sequentially and emit a new entity when the RDF subject changes, without loading the entire RDF file into memory first. Note that the input data cannot contain RDF Blank Nodes (aka BNodes) in this case. The property has no effect on formats other than nt.

false

if_source_empty

Enum<String>

Determines the behaviour of the pipe when the RDF source does not return any entities. Normally, any previously synced entities will be deleted even if the pipe does not receive any entities from its source. If set to "fail", the pipe will automatically fail if the source returns no entities. This means that any previous entities in the pipe’s dataset are not deleted. If set to "accept", the pipe will not fail and any previously synced entities will be deleted.

The global default global_defaults.if_source_empty can be set for all pipes in the service metadata.

"accept"

Continuation support

See the section on continuation support for more information.

Property

Value

supports_since

false (Default)

is_since_comparable

true (Default)

is_chronological

false (Default)

Example configuration

The outermost object would be your pipe configuration, which is omitted here for brevity:

{
    "source": {
        "type": "rdf",
        "url": "http://www.snee.com/rdf/elvisimp.rdf",
        "format": "xml",
    }
}