|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.platform.relations.jena.JenaGraph
public class JenaGraph
Jena plugin for NXRelations.
Graph implementation using the Jena framework.
Constructor Summary | |
---|---|
JenaGraph()
|
Method Summary | |
---|---|
void |
add(List<Statement> statements)
Adds given list of Statement objects to the graph. |
void |
clear()
Clears the graph, removing all statements in it. |
Map<String,String> |
getNamespaces()
Returns namespaces for the graph. |
List<Node> |
getObjects(Node subject,
Node predicate)
Gets items matching the statement pattern (subject, predicate, null). |
List<Node> |
getPredicates(Node subject,
Node object)
Gets items matching the statement pattern (subject, null, object). |
List<Statement> |
getStatements()
Returns all statements in the graph. |
List<Statement> |
getStatements(Statement statement)
Returns all statements in the graph matching the pattern. |
List<Node> |
getSubjects(Node predicate,
Node object)
Get items matching the statement pattern (null, predicate, object). |
boolean |
hasResource(Resource resource)
Returns true if given resource appears in any statement of the graph. |
boolean |
hasStatement(Statement statement)
Returns true if given statement pattern is in the graph. |
QueryResult |
query(String queryString,
String language,
String baseURI)
Query the graph using a base URI. |
boolean |
read(InputStream in,
String lang,
String base)
Parses source into the graph. |
boolean |
read(String path,
String lang,
String base)
Parses source into the graph. |
void |
remove(List<Statement> statements)
Removes given list of Statement objects from the graph. |
void |
setName(String name)
Sets name for the graph. |
void |
setNamespaces(Map<String,String> namespaces)
Sets namespaces for the graph. |
void |
setOptions(Map<String,String> options)
Sets options for the graph. |
Long |
size()
Returns the number of statements in the graph. |
boolean |
write(OutputStream out,
String lang,
String base)
Serializes graph. |
boolean |
write(String path,
String lang,
String base)
Serializes graph. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JenaGraph()
Method Detail |
---|
public void setName(String name)
Graph
setName
in interface Graph
name
- the new namepublic void setOptions(Map<String,String> options)
Graph
Options are typically: which backend to use, additional parameters for backend (e.g. for instance SQL backend, host, port, user/password...).
setOptions
in interface Graph
options
- map of options for the graphpublic void setNamespaces(Map<String,String> namespaces)
Graph
Namespaces are prefix/namespace bindings, as rdf for http://www.w3.org/1999/02/22-rdf-syntax-ns#. TODO AT: maybe share same namespaces with the relation service?
setNamespaces
in interface Graph
namespaces
- map of namespace bindings for the graphpublic Map<String,String> getNamespaces()
Graph
Namespaces are prefix/namespace bindings, as rdf for http://www.w3.org/1999/02/22-rdf-syntax-ns#.
getNamespaces
in interface Graph
public void add(List<Statement> statements)
Graph
If the graph has reification support, the statement properties are also added to the graph too.
add
in interface Graph
statements
- list of Statement instances to addpublic void remove(List<Statement> statements)
Graph
If the graph has reification support, the deleted statements properties are removed too.
remove
in interface Graph
statements
- List of Statement instances to removepublic List<Statement> getStatements()
Graph
If the graph has reification support, the statements properties are retrieved too.
getStatements
in interface Graph
public List<Statement> getStatements(Statement statement)
Graph
If the graph has reification support, the statements properties are retrieved too.
getStatements
in interface Graph
statement
- pattern to match, can hold null nodes as wildcards
public List<Node> getSubjects(Node predicate, Node object)
Graph
getSubjects
in interface Graph
predicate
- predicate pattern, null acceptedobject
- object pattern, null accepted
public List<Node> getPredicates(Node subject, Node object)
Graph
getPredicates
in interface Graph
subject
- subject pattern, null acceptedobject
- object pattern, null accepted
public List<Node> getObjects(Node subject, Node predicate)
Graph
getObjects
in interface Graph
subject
- subject pattern, null acceptedpredicate
- predicate pattern, null accepted
public boolean hasStatement(Statement statement)
Graph
hasStatement
in interface Graph
statement
- statement pattern, can use null as wild cards
public boolean hasResource(Resource resource)
Graph
hasResource
in interface Graph
public Long size()
XXX AT: this size may not be equal to the number of statements retrieved via getStatements() because it counts each statement property.
size
in interface Graph
public void clear()
Graph
clear
in interface Graph
public QueryResult query(String queryString, String language, String baseURI)
Graph
query
in interface Graph
queryString
- the query stringlanguage
- the query language (sparql, rdql,...)baseURI
- the base URI to use for query
public boolean read(InputStream in, String lang, String base)
Graph
read
in interface Graph
in
- input streamlang
- format for the input serialization, may be "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null, is "RDF/XML".base
- base uri to be used when converting relative uris to absolute
uris, may be null. If set to "", allows relative uris to be
used in the model.
public boolean read(String path, String lang, String base)
Graph
read
in interface Graph
path
- path on file system where to take the serialization filelang
- format for the input serialization, may be "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null, is "RDF/XML".base
- base uri to be used when converting relative uris to absolute
uris, may be null. If set to "", allows relative uris to be
used in the model.
public boolean write(OutputStream out, String lang, String base)
Graph
write
in interface Graph
out
- output streamlang
- format for the input serialization, may be "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null, is "RDF/XML".base
- base uri to be used when converting relative uris to absolute
uris, may be null. If set to "", allows relative uris to be
used in the model.
public boolean write(String path, String lang, String base)
Graph
write
in interface Graph
path
- path on file system where to put the serialization filelang
- format for the input serialization, may be "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null, is "RDF/XML".base
- base uri to be used when converting relative uris to absolute
uris, may be null. If set to "", allows relative uris to be
used in the model.
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |