NOTE: This document outlines a feature that was never fully tested in the platform, but appears to work (at least for simple cases). Use at your own risk, and test your usages as you do.
BASE
is a very useful thing to know about in data.world. It is set to the dataset where the file was uploaded be default. It
can be used in prefixes, or directly in triples using the <..>
syntax.
NOTE: Does not currently work for .r2rml
files.
PREFIX : <> # required if you want to use `:` in your statements
PREFIX foo: <../different-dataset/> # reletive prefix IRI
# SUBJECT: https://{org}.linked.data.world/d/{datatset}/thing1
<thing1> a <Thing> .
# SUBJECT: https://{org}.linked.data.world/d/thing2
<../thing2> a <Thing> .
# SUBJECT: https://{org}.linked.data.world/d/different-dataset/foo/thing3
foo:thing3 a :Thing .
:shad <hasThing> <../thing2> .
<shad> :hasThing foo:thing3 .
You can query this data. The following are exactly the same semantically.
BASE <local://>
SELECT *
WHERE {
?aThing <hasThing> ?anotherThing.
}

And...
PREFIX : <local://>
SELECT *
WHERE {
?aThing :hasThing ?anotherThing.
}

NOTE: that prefixes don't get shortened in this version, but that is not important to the overall functionality. Just a by-product of how do the prefix replacement.
You can also set BASE
in SPARQL. This includes setting it to the special local://
IRI, which always points to the target dataset. This has the benefit of very readable FROM
statements.
BASE <local://>
PREFIX aice: <https://data.world/aice/1.0/>
SELECT *
FROM <file/ontology.ttl>
WHERE {
?s ?p ?o
}