Package com.powsybl.cgmes.model
Class EmptyTripleStore
java.lang.Object
com.powsybl.cgmes.model.EmptyTripleStore
- All Implemented Interfaces:
TripleStore
- Author:
- Miora Vedelago <miora.ralambotiana at rte-france.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(TripleStore source) Add all statements of the source Triplestore to this Triplestore.add
(String contextName, String namespace, String type, PropertyBag properties) Add to the triple store statements for creating a new resource, instance of a specific classvoid
add
(String contextName, String namespace, String type, 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.void
defineQueryPrefix
(String prefix, String namespace) Define namespace prefix bindings that will be used in the text of queries.Return the implementation name defined in the triple storeReturn the namespaces defined in the triple storevoid
print
(PrintStream out) Print a summary of the contents of the Triplestore.void
Print a summary of the contents of the Triplestore.Perform a SPARQL query on the Triplestore.void
read
(InputStream is, String base, String contextName) Read statements from an input stream and store them in the Triplestore under the given context name.void
Perform a SPARQL update on the Triplestore.void
write
(DataSource ds) Write the contents of the Triplestore in the given data source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.powsybl.triplestore.api.TripleStore
getOptions, write
-
Constructor Details
-
EmptyTripleStore
public EmptyTripleStore()
-
-
Method Details
-
read
Description copied from interface:TripleStore
Read statements from an input stream and store them in the Triplestore under the given context name.- Specified by:
read
in interfaceTripleStore
- Parameters:
is
- input stream containing statements that will be added to the Triplestorebase
- 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- Specified by:
write
in interfaceTripleStore
- Parameters:
ds
- the output data source
-
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).- Specified by:
print
in interfaceTripleStore
- Parameters:
out
- output stream where the summary will be written
-
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).- Specified by:
print
in interfaceTripleStore
- Parameters:
liner
- a function that accepts strings (the lines of the summary report)
-
clear
Description copied from interface:TripleStore
Delete all the statements in a given context.- Specified by:
clear
in interfaceTripleStore
- Parameters:
contextName
- the context to be cleared
-
defineQueryPrefix
Description copied from interface:TripleStore
Define namespace prefix bindings that will be used in the text of queries. Example:tripleStore.defineQueryPrefix("foaf", "http://xmlns.com/foaf/0.1/");
- Specified by:
defineQueryPrefix
in interfaceTripleStore
- Parameters:
prefix
- the prefix to be used in the text of queries as a replacement for the namespacenamespace
- the URL of the namespace
-
query
Description copied from interface:TripleStore
Perform a SPARQL query on the Triplestore.- Specified by:
query
in interfaceTripleStore
- 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 to the triple store statements for creating new resources, instances of a specific class- Specified by:
add
in interfaceTripleStore
- Parameters:
contextName
- context where the statements are addednamespace
- the namespace of the class of the new resourcestype
- 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- Specified by:
add
in interfaceTripleStore
- Parameters:
contextName
- the context where the statements are addednamespace
- the namespace of the class of the new resourcetype
- the class of the new resourceproperties
- properties of the resource- Returns:
- the id of the new resource
-
add
Description copied from interface:TripleStore
Add all statements of the source Triplestore to this Triplestore.- Specified by:
add
in interfaceTripleStore
- Parameters:
source
- the Triplestore containing statements to be added to this Triplestore
-
contextNames
Description copied from interface:TripleStore
Get all the context names currently defined in the Triplestore.- Specified by:
contextNames
in interfaceTripleStore
- Returns:
- a set of all context names
-
update
Description copied from interface:TripleStore
Perform a SPARQL update on the Triplestore.- Specified by:
update
in interfaceTripleStore
- Parameters:
queryText
- the text of the query, written in SPARQL Update language
-
addNamespace
Description copied from interface:TripleStore
Add a namespace to the triple store- Specified by:
addNamespace
in interfaceTripleStore
- Parameters:
prefix
- the prefix of the namespacenamespace
- the namespace
-
getNamespaces
Description copied from interface:TripleStore
Return the namespaces defined in the triple store- Specified by:
getNamespaces
in interfaceTripleStore
- Returns:
- the list of namespaces defined in the triple store
-
getImplementationName
Description copied from interface:TripleStore
Return the implementation name defined in the triple store- Specified by:
getImplementationName
in interfaceTripleStore
- Returns:
- the string implementation name of the triplestore object
-