Class TripleStoreRDF4J
java.lang.Object
com.powsybl.triplestore.api.AbstractPowsyblTripleStore
com.powsybl.triplestore.impl.rdf4j.TripleStoreRDF4J
- All Implemented Interfaces:
TripleStore
- Author:
- Luma ZamarreƱo <zamarrenolm at aia.es>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(TripleStore source) Add all statements of the source Triplestore to this Triplestore.add
(String contextName, String objNs, String objType, PropertyBag object) Add to the triple store statements for creating a new resource, instance of a specific classvoid
add
(String contextName, String objNs, String objType, PropertyBags objects) 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
Delete all the statements in a given context.Get all the context names currently defined in the Triplestore.Return the implementation name defined in the triple storeReturn the namespaces defined in the triple storeorg.eclipse.rdf4j.repository.Repository
void
print
(PrintStream out) Print a summary of the contents of the Triplestore.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
setWriteBySubject
(boolean writeBySubject) void
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, createRdfId, defineQueryPrefix, getOptions, namespaceForContexts, outputStream, print, rdfDescriptionClass
-
Constructor Details
-
TripleStoreRDF4J
public TripleStoreRDF4J() -
TripleStoreRDF4J
-
-
Method Details
-
getImplementationName
Description copied from interface:TripleStore
Return the implementation name defined in the triple store- Returns:
- the string implementation name of the triplestore object
-
getRepository
public org.eclipse.rdf4j.repository.Repository getRepository() -
setWriteBySubject
public void setWriteBySubject(boolean writeBySubject) -
read
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
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
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
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
Description copied from interface:TripleStore
Get all the context names currently defined in the Triplestore.- Returns:
- a set of all context names
-
clear
Description copied from interface:TripleStore
Delete all the statements in a given context.- Parameters:
contextName
- the context to be cleared
-
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
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
Description copied from interface:TripleStore
Perform a SPARQL update on the Triplestore.- Parameters:
query
- the text of the query, written in SPARQL Update language
-
add
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 resourcesobjects
- properties of the resources
-
add
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 resourceobject
- properties of the resource- Returns:
- the id of the new resource
-
addNamespace
Description copied from interface:TripleStore
Add a namespace to the triple store- Parameters:
prefix
- the prefix of the namespacenamespace
- the namespace
-
getNamespaces
Description copied from interface:TripleStore
Return the namespaces defined in the triple store- Returns:
- the list of namespaces defined in the triple store
-