Class TripleStoreJena
- java.lang.Object
-
- com.powsybl.triplestore.api.AbstractPowsyblTripleStore
-
- com.powsybl.triplestore.impl.jena.TripleStoreJena
-
- All Implemented Interfaces:
TripleStore
public class TripleStoreJena extends AbstractPowsyblTripleStore
- Author:
- Luma ZamarreƱo
-
-
Constructor Summary
Constructors Constructor Description TripleStoreJena()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TripleStore source)
Add all statements of the source Triplestore to this Triplestore.String
add(String contextName, String objNs, String objType, PropertyBag properties)
Add to the triple store statements for creating a new resource, instance of a specific classvoid
add(String contextName, String objNs, String objType, PropertyBags statements)
Add to the triple store statements for creating new resources, instances of a specific classvoid
addNamespace(String prefix, String namespace)
Add a namespace to the triple storevoid
clear(String contextName)
Delete all the statements in a given context.Set<String>
contextNames()
Get all the context names currently defined in the Triplestore.String
getImplementationName()
Return the implementation name defined in the triple storeList<PrefixNamespace>
getNamespaces()
Return the namespaces defined in the triple storevoid
print(PrintStream out)
Print a summary of the contents of the Triplestore.PropertyBags
query(String query)
Perform a SPARQL query on the Triplestore.void
read(InputStream is, String baseName, String contextName)
Read statements from an input stream and store them in the Triplestore under the given context name.void
update(String query)
Perform a SPARQL update on the Triplestore.void
write(DataSource ds)
Write the contents of the Triplestore in the given data source.void
write(DataSource ds, String contextName)
Write the contents of a context in the given data source.-
Methods inherited from class com.powsybl.triplestore.api.AbstractPowsyblTripleStore
adjustedQuery, defineQueryPrefix, namespaceForContexts, outputStream, print, rdfDescriptionClass
-
-
-
-
Method Detail
-
getImplementationName
public String getImplementationName()
Description copied from interface:TripleStore
Return the implementation name defined in the triple store- Returns:
- the string implementation name of the triplestore object
-
read
public void read(InputStream is, String baseName, String contextName)
Description copied from interface:TripleStore
Read statements from an input stream and store them in the Triplestore under the given context name.- Parameters:
is
- input stream containing statements that will be added to the TriplestorebaseName
- the base URI used to convert relative URI's to absolute URI'scontextName
- name of the context where statements will be added
-
write
public void write(DataSource ds)
Description copied from interface:TripleStore
Write the contents of the Triplestore in the given data source. Statements in each context will be written to separate fileNames in the output data source- Parameters:
ds
- the output data source
-
write
public void write(DataSource ds, String contextName)
Description copied from interface:TripleStore
Write the contents of a context in the given data source.- Parameters:
ds
- the output data sourcecontextName
- the context to write
-
print
public void print(PrintStream out)
Description copied from interface:TripleStore
Print a summary of the contents of the Triplestore. Typically a list of contexts and its size (number of statements).- Parameters:
out
- output stream where the summary will be written
-
contextNames
public Set<String> contextNames()
Description copied from interface:TripleStore
Get all the context names currently defined in the Triplestore.- Returns:
- a set of all context names
-
clear
public void clear(String contextName)
Description copied from interface:TripleStore
Delete all the statements in a given context.- Parameters:
contextName
- the context to be cleared
-
query
public PropertyBags query(String query)
Description copied from interface:TripleStore
Perform a SPARQL query on the Triplestore.- Parameters:
query
- the text of the query, written in SPARQL query language- Returns:
- the solution sequence of the query (the ways in which the query matches the data)
-
add
public void add(TripleStore source)
Description copied from interface:TripleStore
Add all statements of the source Triplestore to this Triplestore.- Parameters:
source
- the Triplestore containing statements to be added to this Triplestore
-
update
public void update(String query)
Description copied from interface:TripleStore
Perform a SPARQL update on the Triplestore.
-
add
public void add(String contextName, String objNs, String objType, PropertyBags statements)
Description copied from interface:TripleStore
Add to the triple store statements for creating new resources, instances of a specific class- Parameters:
contextName
- context where the statements are addedobjNs
- the namespace of the class of the new resourcesobjType
- the class of the new resourcesstatements
- properties of the resources
-
add
public String add(String contextName, String objNs, String objType, PropertyBag properties)
Description copied from interface:TripleStore
Add to the triple store statements for creating a new resource, instance of a specific class- Parameters:
contextName
- the context where the statements are addedobjNs
- the namespace of the class of the new resourceobjType
- the class of the new resourceproperties
- properties of the resource- Returns:
- the id of the new resource
-
addNamespace
public void addNamespace(String prefix, String namespace)
Description copied from interface:TripleStore
Add a namespace to the triple store- Parameters:
prefix
- the prefix of the namespacenamespace
- the namespace
-
getNamespaces
public List<PrefixNamespace> getNamespaces()
Description copied from interface:TripleStore
Return the namespaces defined in the triple store- Returns:
- the list of namespaces defined in the triple store
-
-