Loading TOC...

GET /v1/graphs/things


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

URL Parameters
iri* IRIs about which to return information.
database? Perform this operation on the named content database instead of the default content database associated with the REST API instance. Using an alternative database requires the "eval-in" privilege; for details, see Security Requirements in the REST Application Developer's Guide.
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 Formats 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.


Upon success, MarkLogic Server returns status 200 (OK) and the response body contains the requested data. If your 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).

Required Privileges

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


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.


$ curl --anyauth --user user:password -i -X GET -H "Accept: text/html" \

==> 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">
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Abraham_Lincoln">&lt;http://dbpedia.org/resource/Abraham_Lincoln&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alan_Turing">&lt;http://dbpedia.org/resource/Alan_Turing&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Aleister_Crowley">&lt;http://dbpedia.org/resource/Aleister_Crowley&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alexander_Mackenzie">&lt;http://dbpedia.org/resource/Alexander_Mackenzie&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alfonso_Arau">&lt;http://dbpedia.org/resource/Alfonso_Arau&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Alfred_Lawson">&lt;http://dbpedia.org/resource/Alfred_Lawson&gt;</a>
    <a href="/v1/graphs/things?iri=http%3a//dbpedia.org/resource/Aristotle">&lt;http://dbpedia.org/resource/Aristotle&gt;</a>


$ curl --anyauth --user user:password -i -X GET -H "Accept: text/turtle" \

==> 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 .


    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy