This page was generated
January  28,  2016
4:07  AM
XQuery & XSLT Built-In & Modules Function Reference

Module: Client API - Semantics Functions

Use the interfaces in this section to manage and query semantic graph data. The API capabilities include the following:
  • Insert, merge, or replace triples.
  • Retrieve a graph.
  • Perform a SPARQL query.

NOTE: You must enable the collection lexicon on your database before using the semantics interfaces. You can enable the collection lexicon using the Admin Interface.

For details, see 'Loading Triples' in the REST Application Developer's Guide, 'Querying Triples' in the REST Application Developer's Guide, and the Semantics Developer's Guide.

REST Resource Summary
DELETE /v1/graphs Remove triples in a named graph or the default graph.
GET /v1/graphs Retrieve a graph or a list of available graph URIs.
HEAD /v1/graphs Returns the same headers as an equivalent GET on the /graphs service.
POST /v1/graphs Merge triples into a named graph or the default graph.
PUT /v1/graphs Create or replace triples in a named graph or the default graph.
GET /v1/graphs/sparql Used to perform a SPARQL query on the database.
POST /v1/graphs/sparql Used to perform a SPARQL query on one or more graphs.
GET /v1/graphs/things Retrieve a list of all graph nodes in the database, or a specified set of nodes.
REST Resource Detail
DELETE /v1/graphs
Summary:

Remove triples in a named graph or the default graph.

Parameters:
graph : The name of the graph to modify. You cannot use this parameter in conjunction with the default parameter.
default : Indicates the request should modify the default graph. You cannot use this parameter in conjunction with the graph parameter.

Required Privilege:

This operation requires the rest-writer role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-writer


Response:

MarkLogic Server returns status 204 (Updated).

Usage Notes:

This interface implements the DELETE method of the W3C Graph Store HTTP Protocol; for details, see http://www.w3.org/TR/sparql11-http-rdf-update/. This implementation differs from the standard in that it returns status 204 even if the target graph does not exist.

This operation only updates triples documents. That is, documents with a sem:triples root element, such as those created using PUT or POST on /graphs. It has no effect on triples embedded in regular XML documents. If you delete a graph that contains both embedded triples and triples stored in triples documents, the embedded triples, and therefore the graph, remain even after this operation returns success.

For details, see 'Deleting Triples' in the Semantics Developer's Guide.


Example:
$ curl --anyauth --user user:password -i -X DELETE \
    http://localhost:8003/v1/graphs?graph=/my/named/graph

HTTP/1.1 204 Updated
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

GET /v1/graphs
Summary:

Retrieve a graph or a list of available graph URIs.

Parameters:
graph? : The URI of the named graph to retrieve. You cannot use this parameter with the default parameter.
default? : Indicates the request should return the default graph. This parameter accepts no value. You cannot use this parameter with the graph parameter.

Request Headers:
Accept*: The expected MIME type of the response. When retrieving a list of available graphs (no request parameters), you can specify text/plain, text/html, or text/uri-list (default). When retrieving a named graph or the default graph, you can specify any of the MIME types listed in 'Supported RDF Triple Serializations' in the Semantics Developer's Guide.

Response Headers:
Content-Type: The MIME type of the data in the response body, corresponding to the MIME type in the Accept header.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK). If a named graph or the default graph is requested, the response body contains the graph data. If neither the graph nor default request parameters are present, the response body contains a list of available graph URIs. If you request triples in an unsupported format, MarkLogic Server returns status 406 (Not Acceptable).

Usage Notes:

This interface implements the GET method of the W3C Graph Store HTTP Protocol; for details, see http://www.w3.org/TR/sparql11-http-rdf-update/.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.


Example:
$ curl --anyauth --user user:password -i -X GET \
    'http://localhost:8003/v1/graphs'

==> Retrieve a list of graphs in the database. Since no Accept
    is given, results are returned as text/uri-list. MarkLogic Server
    responds with output similar to the following:

HTTP/1.1 200 OK
Content-type: text/uri-list; charset=UTF-8
Server: MarkLogic
Content-Length: 61
Connection: Keep-Alive
Keep-Alive: timeout=5

/my/named/graph
http://marklogic.com/semantics#default-graph

If you request output as text/html, MarkLogic Server returns
data in the response body similar to the following:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Graphs</title>
  </head>
  <body>
    <ul>
      <li>/my/named/graph</li>
      <li>http://marklogic.com/semantics#default-graph</li>
    </ul>
  </body>
</html>
  
Example:
$ curl --anyauth --user user:password -i -X GET -H "Accept: text/turtle"
    'http://localhost:8003/v1/graphs?graph=/my/named/graph'

==> Retrieve the graph with URI /my/named/graph, in Turtle format. 
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Content-type: text/turtle; charset=UTF-8
Server: MarkLogic
Content-Length: 6680
Connection: Keep-Alive
Keep-Alive: timeout=5

@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
<http://dbpedia.org/resource/Abraham_Lincoln> <http://dbpedia.org/ontology/birthDate> "1809-02-12"^^xs:date .
<http://dbpedia.org/resource/Alan_Turing> <http://dbpedia.org/ontology/birthDate> "1912-06-23"^^xs:date .
  

HEAD /v1/graphs
Summary:

Returns the same headers as an equivalent GET on the /graphs service.

Parameters:
graph? : Specify the URI of a named graph. You cannot use this parameter with the default parameter.
default? : Indicates the request should act on the default graph. This parameter accepts no value. You cannot use this parameter with the graph parameter.

Request Headers:
Accept*: The expected MIME type of the response.

Response Headers:
Content-Type: The MIME type of the data that would be returned by a GET request.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK) and the same headers that are returned by an equivalent GET on the /documents service.

Usage Notes:

Use this method to determine what headers an equivalent GET will return. This interface implements the HEAD method of the W3C Graph Store HTTP Protocol; for details, see http://www.w3.org/TR/sparql11-http-rdf-update/.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.


Example:
$ curl --anyauth --user user:password -i -X HEAD -H "Accept: text/turtle" \
    http://localhost:8003/v1/graphs?graph=/my/named/graph

HTTP/1.1 200 OK
Content-type: text/turtle; charset=UTF-8
Server: MarkLogic
Connection: Keep-Alive
Keep-Alive: timeout=5
  

POST /v1/graphs
Summary:

Merge triples into a named graph or the default graph.

Parameters:
graph? : The URI of the named graph to modify. You cannot use this parameter with the default parameter.
default? : Indicates the request should modify the default graph. This parameter accepts no value. You cannot use this parameter with the graph parameter.
repair : If set to true, triples in the request body that cannot be parsed are skipped, and parsable triples are inserted. If set to false, triples in the request body that cannot be parsed cause all the data in the request to be rejected. Default: false.

Request Headers:
Content-Type: The MIME type of the data in the request body. For details, see 'Supported RDF Triple Serializations' in the Semantics Developer's Guide.

Required Privilege:

This operation requires the rest-writer role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-writer


Response:

Upon success, MarkLogic Server returns status 201 (Created) or status 204 (Updated). If there are errors in the payload, the response body contains further information about the errors. If the request body is in an unsupported format, MarkLogic Server returns status 415 (Unsupported Media Type).

Usage Notes:

Supplying an empty graph is a no-op.

This interface implements the POST method of the W3C Graph Store HTTP Protocol; for details, see http://www.w3.org/TR/sparql11-http-rdf-update/. Additional capabilities are available through the XQuery API and the mlcp command line tool. For details, see 'Updating Triples' in the Semantics Developer's Guide.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.


Example:
NOTE: Be sure to use --data-binary rather than -d if extracting
the request body from a file with curl, as shown below.

$ curl --anyauth --user user:password -i -X POST \
    --data-binary @./example.nq -H "Content-type: application/n-quads" \
    http://localhost:8003/v1/graphs?default

==> The N-Quad data in example.nq is merged into the default graph.
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 201 Created
Location:
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  
Example:
NOTE: Be sure to use --data-binary rather than -d if extracting
the request body from a file with curl, as shown below.

$ curl --anyauth --user user:password -i -X POST \
    --data-binary @./example.ttl -H "Content-type: text/turtle" \
    http://localhost:8003/v1/graphs?graph=/my/named/graph

==> The Turtle data in example.ttl is merged into the named graph
    with the URI /my/named/graph. MarkLogic Server responds with 
    output similar to the following:

HTTP/1.1 201 Created
Location:
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

PUT /v1/graphs
Summary:

Create or replace triples in a named graph or the default graph.

Parameters:
graph? : The URI of the named graph to modify. You cannot use this parameter with the default parameter.
default? : Indicates the request should modify the default graph. This parameter accepts no value. You cannot use this parameter with the graph parameter.
repair : If set to true, triples in the request body that cannot be parsed are skipped, and parsable triples are inserted. If set to false, triples in the request body that cannot be parsed cause all the data in the request to be rejected. Default: false.

Request Headers:
Content-Type: The MIME type of the data in the request body. For details, see 'Supported RDF Triple Serializations' in the Semantics Developer's Guide.

Required Privilege:

This operation requires the rest-writer role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-writer

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.


Response:

Upon success, MarkLogic Server returns status 201 (Created) or status 200 (OK). If there are errors in the payload, the response body contains further information about the errors. If the request body is in an unsupported format, MarkLogic Server returns status 415 (Unsupported Media Type).

Usage Notes:

A PUT request is functionally equivalent to a DELETE followed by a POST. Supplying an empty graph is equivalent to deleting the graph.

This interface implements the PUT method of the W3C Graph Store HTTP Protocol; for details, see http://www.w3.org/TR/sparql11-http-rdf-update/. Additional capabilities for loading triples are available through the XQuery API and the mlcp command line tool. For details, see 'Loading Triples' in the Semantics Developer's Guide.

Files submitted to this endpoint are limited in size based on the format of the documents, which is 512MB for XML files (for example, rdf .rdf files) and 64MB for text documents (for example, turtle .ttl files).


Example:
NOTE: Be sure to use --data-binary rather than -d if extracting
the request body from a file with curl, as shown below.

$ curl --anyauth --user user:password -i -X PUT --data-binary @./example.ttl \
    -H "Content-type: text/turtle" \
    http://localhost:8003/v1/graphs?default

==> The Turtle data in example.ttl is created as the default graph.
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 201 Created
Location:
Server: MarkLogic
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=5
  

GET /v1/graphs/sparql
Summary:

Used to perform a SPARQL query on the database. The result output format will depend on the type of SPARQL query in the url-encoded query and the parameters used for the Accept Header Type in the REST request. There are four types of SPARQL queries (SELECT, CONSTRUCT, DESCRIBE and ASK), each with different result formats. The Accept Header Type in the REST request sets the expected MIME type for the response output. For more details, see 'Querying Triples with REST API' in the Semantics Developer's Guide.

Parameters:
query : A URL-encoded SPARQL query.
default-graph-uri* : Specify the URI of a graph to use as the default graph.
named-graph-uri* : Specify the URI of a named graph to include in the query.

Request Headers:
Accept*: The expected MIME type of the response. For supported type information, see 'Response Output Formats' in the Semantics Developer's Guide.

Response Headers:
Content-type: The MIME type of the data in the response body. The MIME type depends on the type of information generated by the query. For details, see 'Response Output Formats' in the Semantics Developer's Guide.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK) and the response body contains the query result. If you request results in an unsupported format, MarkLogic Server returns status 406 (Not Acceptable).

Usage Notes:

This interface implements the GET method of the W3C SPARQL Protocol; for details, see http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321.

You can specify the RDF Dataset against which to execute the query using the named-graph-uri and default-graph-uri request parameters, or within the query. If the dataset is specified in both the request parameters and the query, the dataset defined by the request parameters is used. If neither is specified, all graphs are queried.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.

For more details, see 'Querying Triples with REST API' in the Semantics Developer's Guide.


Example:
$ curl --anyauth --user user:password -i -X GET \
    -H "Accept: application/sparql-results+json" \
    http://localhost:8003/v1/graphs/sparql?query=your-urlencoded-query

==> Run the SPARQL query passed as the URL encoded value of the
    query request parameter. MarkLogic Server responds with output
    similar to the following:

HTTP/1.1 200 OK
Content-type: application/sparql-results+json
Server: MarkLogic
Content-Length: 126
Connection: Keep-Alive
Keep-Alive: timeout=5

{
  "head": {
    "vars": [ "s" ]
  },
  "results": {
    "bindings": [ {
      "s": {
        "type": "uri",
        "value": "http://dbpedia.org/resource/Alfonso_Arau"
      }
    } ]
  }
}

If you set the Accept header to application/sparql-results+xml, 
MarkLogic Server returns data similar to the following:

<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
  </head>
  <results>
    <result>
      <binding name="s">
        <uri>http://dbpedia.org/resource/Alfonso_Arau</uri>
      </binding>
    </result>
  </results>
</sparql>
  

POST /v1/graphs/sparql
Summary:

Used to perform a SPARQL query on one or more graphs. The result output format will depend on the type of SPARQL query and the parameters used for the Accept Header Type in the REST request. There are four types of SPARQL queries (SELECT, CONSTRUCT, DESCRIBE and ASK), each with different result formats. The Accept Header Type in the REST request sets the expected MIME type for the response output. For more details, see 'Querying Triples with REST API' in the Semantics Developer's Guide.

Parameters:
default-graph-uri* : Specify the default graph URI.
named-graph-uri* : Specify the URI of a named graph to include in the query.
query : A URL-encoded SPARQL query. You should only use this parameter when you put request parameters in the request body and use application/x-www-form-urlencoded as the request content type.

Request Headers:
Accept*: The expected MIME type of the response. For supported type information, see 'Response Output Formats' in the Semantics Developer's Guide.
Content-type: The MIME type of the query in the request body. Allowed values: application/x-www-form-urlencoded, application/sparql-query.

Response Headers:
Content-type: The MIME type of the data in the response body. The MIME type depends on the type of information generated by the query. For details, see 'Response Output Formats' in the Semantics Developer's Guide.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK) and the response body contains the query result. If you request results in an unsupported format, MarkLogic Server returns status 406 (Not Acceptable).

Usage Notes:

This interface implements the POST method of the W3C SPARQL Protocol; for details, see http://www.w3.org/TR/2013/REC-sparql11-protocol-20130321/.

If you use application/x-www-form-urlencoded for the request body content type, put all request parameters in the body, with their values URL-encoded. Separate parameters with an ampersand. Specify your SPARQL query using the query request parameter.

If you use application/sparql-query for the request body content type, the body must contain only an unencoded SPARQL query, and you cannot specify a query request parameter.

You can specify the RDF Dataset against which to execute the query using the named-graph-uri and default-graph-uri request parameters, or within the query. If the dataset is specified in both the request parameters and the query, the dataset defined by the request parameters is used. If neither is specified, all graphs are queried.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.

For more details, see 'Querying Triples with REST API' in the Semantics Developer's Guide.


Example:
NOTE: Be sure to use --data-binary rather than -d if extracting
the request body from a file with curl, as shown below.

$ cat mexico.sparql
SELECT ?s WHERE {
  ?s 
  <http://dbpedia.org/ontology/birthPlace> 
  <http://dbpedia.org/resource/Mexico> 
}
LIMIT 5

$ curl --anyauth --user user:password -i -X POST \
    --data-binary @./mexico.sparql \
    -H "Content-type: application/sparql-query" \
    -H "Accept: application/sparql-results+xml" \
    http://localhost:8003/v1/graphs/sparql

==> Run a SPARQL query, placing the unencoded query in the POST body.
    MarkLogic Server responds with output similar to the following:

HTTP/1.1 200 OK
Content-type: application/sparql-results+xml
Server: MarkLogic
Content-Length: 213
Connection: Keep-Alive
Keep-Alive: timeout=5

<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="s"/>
  </head>
  <results>
    <result>
	  <binding name="s">
	    <uri>http://dbpedia.org/resource/Aaron_Herrera</uri>
	  </binding>
	</result>
    <result>
	  <binding name="s">
	    <uri><http://dbpedia.org/resource/Abel_Ramirez></uri>
	  </binding>
	</result>
    <result>
	  <binding name="s">
	    <uri>http://dbpedia.org/resource/Abel_Salazar_(actor)</uri>
	  </binding>
	</result>
    <result>
	  <binding name="s">
	    <uri>http://dbpedia.org/resource/Abigail_Elizalde</uri>
	  </binding>
	</result>
    <result>
	  <binding name="s">
	    <uri>http://dbpedia.org/resource/Abismo_Negro</uri>
	  </binding>
	</result>
  </results>
</sparql>

The following is the equivalent results returned as 
application/sparql-results+json:

{
  "head":{
    "vars":["s"]
	}, 
	"results":{
	  "bindings":[{
	    "s":{
		  "type":"uri", 
		  "value":"http://dbpedia.org/resource/Aaron_Herrera"
		  }}, 
		  {
		"s":{
		  "type":"uri", 
		  "value":"<http://dbpedia.org/resource/Abel_Ramirez>"
		  }}, 
		  {
		"s":{
		  "type":"uri", 
		  "value":"http://dbpedia.org/resource/Abel_Salazar_(actor)"
		  }},
		  {
		"s":{
		  "type":"uri", "value":"http://dbpedia.org/resource/Abigail_Elizalde"
		  }}, 
		  {
		"s":{
		  "type":"uri", 
		  "value":"http://dbpedia.org/resource/Abismo_Negro"
		  }}
		]
	}
}
  
Example:
$  curl --anyauth --user user:password -i -X POST \
   --data  "query=SELECT%20%3Fs%20WHERE%20%7B%0A%20 \
   %20%3Fs%20%0A%20%20%3Chttp%3A%2F%2Fdbpedia.org  \ 
   %2Fontology%2FbirthPlace%3E%20%0A%20%20%3Chttp \
   %3A%2F%2Fdbpedia.org%2Fresource%2FMexico%3E%20 \
   %0A%7D" -H "Content-type:application/x-www-form-urlencoded" \
   -H "Accept:application/sparql-results+xml" \
   http://localhost:8004/v1/graphs/sparql

==> Run a SPARQL query, passing the URL-encoded query as form data.
    MarkLogic Server responds with triples similar to the following:

HTTP/1.1 200 OK
Content-type: application/sparql-results+xml
Server: MarkLogic
Content-Length: 241432
Connection: Keep-Alive
Keep-Alive: timeout=5

<sparql xmlns="http://www.w3.org/2005/sparql-results#"><head><variable name="s"/>
</head><results>
<result><binding name="s"><uri>http://dbpedia.org/resource/Aaron_Herrera
</uri></binding></result>
<result><binding name="s"><uri><http://dbpedia.org/resource/Abel_Ramirez></uri>
</binding></result>
<result><binding name="s"><uri>http://dbpedia.org/resource/Abel_Salazar_(actor)</uri>
</binding></result>
<result><binding name="s"><uri>http://dbpedia.org/resource/Abigail_Elizalde</uri>
</binding></result>
<result><binding name="s"><uri>http://dbpedia.org/resource/Abismo_Negro</uri>
</binding></result>
</sparql> 

GET /v1/graphs/things
Summary:

Retrieve a list of all graph nodes in the database, or a specified set of nodes.

Parameters:
iri* : IRIs about which to return information.

Request Headers:
Accept*: The expected MIME type of the response. With no parameters, the only supported MIME type is text/html. When the iri parameter is used, you can specify any of the MIME types listed in 'Supported RDF Triple Serializations' in the Semantics Developer's Guide.

Response Headers:
Content-type: The MIME type of the data in the response body. The MIME type corresponds to the type requested by the Accept header.

Required Privilege:

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader


Response:

Upon success, MarkLogic Server returns status 200 (OK) and the response body contains the requested data. If you request results in an unsupported format, MarkLogic Server returns status 406 (Not Acceptable). If a specified IRI does not exist, MarkLogic server returns status 404 (Not Found).

Usage Notes:

With no request parameters, this method returns a list of nodes in the database, both blank and named. If you specify one or more IRI's using iri, information is returned about just those nodes. The information is in CBD triple format.

This operation returns a maximum of 10,000 items.

The collection lexicon must be enabled on the database before using the REST graph store interfaces or using the GRAPH '?g' construct in SPARQL queries. You can enable the collection lexicon from the Admin Interface.


Example:
$ curl --anyauth --user admin:adm1n -i -X GET -H "Accept: text/html" \
    http://localhost:8003/v1/graphs/things

==> The list of all graph nodes is returned as XML. MarkLogic Server
    responds with output similar to the following:

HTTP/1.1 200 OK
Content-type: text/html; charset=UTF-8
Server: MarkLogic
Content-Length: 1071
Connection: Keep-Alive
Keep-Alive: timeout=5

<html xmlns="http://www.w3.org/1999/xhtml">
<title>Subjects</title>
<body>
  <h2>Subjects</h2>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Abraham_Lincoln">&lt;http://dbpedia.org/resource/Abraham_Lincoln&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alan_Turing">&lt;http://dbpedia.org/resource/Alan_Turing&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Aleister_Crowley">&lt;http://dbpedia.org/resource/Aleister_Crowley&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alexander_Mackenzie">&lt;http://dbpedia.org/resource/Alexander_Mackenzie&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alfonso_Arau">&lt;http://dbpedia.org/resource/Alfonso_Arau&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alfred_Lawson">&lt;http://dbpedia.org/resource/Alfred_Lawson&gt;</a>
  </p>
  <p>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Aristotle">&lt;http://dbpedia.org/resource/Aristotle&gt;</a>
  </p>
</body>
</html>
  
Example:
$ curl --anyauth --user user:password -i -X GET -H "Accept: text/turtle" \
    http://localhost:8003/v1/graphs/things?iri=http://dbpedia.org/resource/Aleister_Crowley

==> Retrieve the nodes selected by the IRI 
    http://dbpedia.org/resources/Aleister_Crowley in Turtle format.
    MarkLogicServer responds with output similar to the following:

HTTP/1.1 200 OK
Content-type: text/turtle; charset=UTF-8
Server: MarkLogic
Content-Length: 1095
Connection: Keep-Alive
Keep-Alive: timeout=5

@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
<http://dbpedia.org/resource/Aleister_Crowley> <http://dbpedia.org/ontology/deathPlace> <http://dbpedia.org/resource/Hastings> .
<http://dbpedia.org/resource/Aleister_Crowley> <http://dbpedia.org/ontology/birthPlace> <http://dbpedia.org/resource/Royal_Leamington_Spa> .
<http://dbpedia.org/resource/Aleister_Crowley> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
<http://dbpedia.org/resource/Aleister_Crowley> <http://xmlns.com/foaf/0.1/givenName> "Aleister" .
<http://dbpedia.org/resource/Aleister_Crowley> <http://xmlns.com/foaf/0.1/name> "Aleister Crowley" .
<http://dbpedia.org/resource/Aleister_Crowley> <http://xmlns.com/foaf/0.1/surname> "Crowley" .
<http://dbpedia.org/resource/Aleister_Crowley> <http://purl.org/dc/elements/1.1/description> "poet, mountaineer, occultist" .
<http://dbpedia.org/resource/Aleister_Crowley> <http://dbpedia.org/ontology/birthDate> "1875-10-12"^^xs:date .
<http://dbpedia.org/resource/Aleister_Crowley> <http://dbpedia.org/ontology/deathDate> "1947-12-01"^^xs:date .