Get a list of current graphs.
200
{
"data": ["user"]
}
400 Bad Request
$ curl http://localhost:9666/v1/graphs
{"data": ["user"]}
Add a list of triples. The total number inserted is returned. Invalid triples(no sub, pred, or obj) are removed from the insert.
- graph (required) graph name.
- prefix (optional) uri prefix, will replace all items in data. For example foaf:name = http://xmlns.com/foaf/0.1/name
- data (required) triples, uses prefix if defined.
{
"graph": "user",
"prefix": {
"eu": "https://eurisko.io/rdf/0.1/",
"foaf": "http://xmlns.com/foaf/0.1/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
},
"data": [
["_:1", "rdf:type", "foaf:Person"],
["_:1", "foaf:name", "Albert"],
["_:1", "eu:username", "alberto1"],
["_:2", "foaf:name", "Barry"],
["_:2", "eu:username", "bthug"],
["_:3", "foaf:name", "Charles"],
["_:3", "eu:username", "cthug"],
["_:1", "", "_:2"],
["_:1", "foaf:knows", "_:3"]
]
}
200 {"total": 8}
400 Bad Request
405 Method Not Allowed
# Note if no prefix is defined you have to specifiy the full uri of subjects and predicates.
$ curl -d '{"graph":"user", "data": [["_:1", "http://xmlns.com/foaf/0.1/name", "Albert"]]' http://localhost:9666/v1/data
{"total": 1}
Remove a list of triples.
- graph (required) graph name.
- prefix (optional) uri prefix, will replace all items in data. For example foaf:name = http://xmlns.com/foaf/0.1/name
- data (required) triples uses prefix if defined. Empty strings mean delete all for sub, pred, obj.
{
"graph": "user",
"prefix": {
"foaf": "http://xmlns.com/foaf/0.1/"
},
"data": [
["_:1", "foaf:name", "Albert"],
["_:3", "foaf:name", ""]
]
}
200 OK
400 Bad Request
405 Method Not Allowed
# Note if no prefix is defined you have to specifiy the full uri of subjects and predicates.
$ curl -X DELETE -d '{"graph":"user", "data": [["_:1", "http://xmlns.com/foaf/0.1/name", "Albert"]]' http://localhost:9666/v1/data
OK
Get a list of triples. The reason this is json encoded is to preserve the type for the obj parameter(bool,int,string,etc)
- graph (required) graph
- prefix (optional) uri prefix, will replace all items in data. For example foaf:name = http://xmlns.com/foaf/0.1/name
- sub (optional) subject
- pred (optional) predicate
- obj (optional) object, can be nil
- limit (optional:default 20) number of triples to return
- offset (optional:default 0) skip to
- orderby (optional string) sort by sub(s), pred(p), obj(o). A minus in front of the character means descending.
{
"graph": "user",
"prefix": {"foaf": "http://foaf"},
"sub": "_:1",
"pred": "http://xmlns.com/foaf/0.1/knows",
"obj": "_:2",
"limit": 1,
"offset": 0,
"orderby": "-s"
}
200
{
"graph": "user",
"data": [
["_:1", "http://xmlns.com/foaf/0.1/knows", "_:2"],
]
}
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
$ curl -d '{"graph": "user", "sub": "_:1", "pred": "", obj: "_:2"}' http://localhost:9666/v1/triples
{"graph": "user", "data":[["_:1", "http://xmlns.com/foaf/0.1/knows", "_:2"]]}
Get the number of triples for a query.
- graph (required) graph
- prefix (optional) uri prefix, will replace all items in data. For example foaf:name = http://xmlns.com/foaf/0.1/name
- sub (optional) subject
- pred (optional) predicate
- obj (optional) object, can be nil
{
"graph": "user",
"prefix": {"foaf": "http://foaf"},
"sub": "",
"pred": "",
"obj": ""
}
200
{
"graph": "user",
"data": 101
}
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
$ curl -d '{"graph": "user", "sub": "", "pred": "", obj: ""}' http://localhost:9666/v1/triples/count
{"graph": "user", "data": 101}
Get a single value from a triple.
- graph (required) graph
- prefix (optional) uri prefix, will replace all items in data. For example foaf:name = http://xmlns.com/foaf/0.1/name
- sub (optional) subject
- pred (optional) predicate
- obj (optional) object, can be nil
{
"graph": "user",
"prefix": {"foaf": "http://foaf"},
"sub": "_:1",
"pred": "http://xmlns.com/foaf/0.1/knows",
"obj": nil,
}
200
{
"graph": "user",
"data": "_:2"
}
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
$ curl -d '{"graph": "user", "sub": "_:1", "pred": "", obj: ""}' http://localhost:9666/v1/value
{"graph": "user", "data": "_:2"}
Get a list of bound variables.
- graph (required) graph
- data (required) query bindings in triples, uses prefix if defined.
- prefix (optional) uri prefix, will replace all items in data query.
- select (required) array of which variables to return, if empty all variables returned. If count ?COUNT data contains a count.
- optional array of the indexes within data of the triples to treat as optional, meaning return results even if the optional triple has none.
- distinct (optional:default true) return distinct results
- limit (optional:default 20) number of items to return.
- offset (optional:default 0) skip.
- orderby (optional) sort by variable, a minus in front of string means descending sort.
- filter (optional) array of filters [{key: 'clicks', op: '<', val: 3}, {key: 'age', op: '>', val: 20}]
{
"graph": "user",
"prefix": {
"eu": "https://eurisko.io/rdf/0.1/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
"select": ["?userid", "?knows_name", "?knows_username"],
"data": [
["?userid", "foaf:knows", "?knowsid"],
["?knowsid", "foaf:name", "?knows_name"]
["?knowsid", "eu:username", "?knows_username"]
],
"optional": [1, 2],
"distinct": true,
"limit": 2,
"offset": 10,
"orderby": "-userid"
}
200
{
"graph": "user",
"data": [
{"userid": "_:1", "knows_name": "Barry", "knows_username": "bthug"},
{"userid": "_:1", "knows_name": "Charles", "knows_username": "cthug"}
]
}
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
$ curl -d '{"graph": "user", "prefix": {"eu": "https://eurisko.io/rdf/0.1/"}, "data": [["?userid", "eu:name", "Albert"]]' http://localhost:9666/v1/query
{"graph": "user", "data":[["userid", "https://eurisko.io/rdf/0.1/user/2", "name": "Albert"]]}
Apply named inference rule
- graph (required) graph
- inferenece (required) name of the inference to apply, (geo)
200
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
Get any paths available from a start to end node.
- graph (required) graph
- start
- end
- predicateName
- predicateAdjacent
200
{
"graph": "user",
"data": ["a", "connects", "to", "b"]
}
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
Drop a graph and it's indexes
- graph (required) graph name.
200 OK
400 Bad Request
405 Method Not Allowed
500 Internal Server Error
Index a graph
- graph (required) graph name.
- background (optional) index in the background.
200 OK
400 Bad Request
405 Method Not Allowed
500 Internal Server Error