RDF Prefix Resolve API

We provide two API endpoints:

Expanding an IRI

expanding means the following operation:
'xsd:dateTime' → 'http://www.w3.org/2001/XMLSchema#dateTime'.
It is the opposite of /shrinking.

Examples

Success: HTTP200

Copy
DOMAIN=http://localhost:3000
{ "success": true, "value": "http://schema.org/Person" }

Failure: HTTP404

Copy
DOMAIN=http://localhost:3000
curl --silent \
"${DOMAIN}/api/v1/expand?q=hello:World" \
| jq .
{ "success": false }

Shrinking an IRI

shrinking means the following operation:
'http://www.w3.org/2001/XMLSchema#dateTime' → 'xsd:dateTime'.
It is the opposite of /expanding.

IRI containing a #fragment such as
http://www.w3.org/2001/XMLSchema#dateTime will have to be URI encoded:

Copy
DOMAIN=http://localhost:3000

Examples

Success: HTTP200

Copy
DOMAIN=http://localhost:3000
{ "success": true, "value": "schema:Person" }

Failure: HTTP404

Copy
DOMAIN=http://localhost:3000
{ "success": false }

Autocomplete a prefixed term

This endpoint lets you implement RDF terms autocompletion.

By default, this endpoint is case-insensitive. Use &case=true to make it case-sensitive.

Examples

Autocomplete a prefix or find matching namespaces:

Copy
DOMAIN=http://localhost:3000
curl --silent \
"${DOMAIN}/api/v1/autocomplete?q=r" \
| jq .
[ "rdf:", "rdau:", "rdfa:", "rdfs:", "rr:", "rss:" ]

Autocomplete a prefix or find matching namespaces:

Copy
DOMAIN=http://localhost:3000
curl --silent \
"${DOMAIN}/api/v1/autocomplete?q=rdf" \
| jq .
[ "rdf:", "rdfa:", "rdfs:" ]

Autocomplete the content of a namespace:

Copy
DOMAIN=http://localhost:3000
curl --silent \
"${DOMAIN}/api/v1/autocomplete?q=rdfs:" \
| jq .
[ "rdfs:", "rdfs:Class", "rdfs:Container", "rdfs:ContainerMembershipProperty", … ]

Autocomplete a partial term:

Copy
DOMAIN=http://localhost:3000
[ "rdfs:Container", "rdfs:ContainerMembershipProperty", "rdfs:comment" ]

Autocomplete a partial term, case-sensitive:

Copy
DOMAIN=http://localhost:3000
[ "rdfs:comment" ]

Autocomplete a partial term or the content of a namespace, for a given RDF type:

Copy
DOMAIN=http://localhost:3000
[ "rdfs:comment", "rdfs:domain", "rdfs:isDefinedBy", "rdfs:label", … ]