Class TripleStoreRDF4J

java.lang.Object
com.powsybl.triplestore.api.AbstractPowsyblTripleStore
com.powsybl.triplestore.impl.rdf4j.TripleStoreRDF4J
All Implemented Interfaces:
TripleStore

public class TripleStoreRDF4J extends AbstractPowsyblTripleStore
Author:
Luma ZamarreƱo <zamarrenolm at aia.es>
  • Constructor Details

    • TripleStoreRDF4J

      public TripleStoreRDF4J()
    • TripleStoreRDF4J

      public TripleStoreRDF4J(TripleStoreOptions options)
  • Method Details

    • 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
    • getRepository

      public org.eclipse.rdf4j.repository.Repository getRepository()
    • setWriteBySubject

      public void setWriteBySubject(boolean writeBySubject)
    • 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 Triplestore
      baseName - the base URI used to convert relative URI's to absolute URI's
      contextName - 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 source
      contextName - 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.
      Parameters:
      query - the text of the query, written in SPARQL Update language
    • add

      public void add(String contextName, String objNs, String objType, PropertyBags objects)
      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 added
      objNs - the namespace of the class of the new resources
      objType - the class of the new resources
      objects - properties of the resources
    • add

      public String add(String contextName, String objNs, String objType, PropertyBag object)
      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 added
      objNs - the namespace of the class of the new resource
      objType - the class of the new resource
      object - 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 namespace
      namespace - 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