Class EmptyTripleStore

java.lang.Object
com.powsybl.cgmes.model.EmptyTripleStore
All Implemented Interfaces:
TripleStore

public final class EmptyTripleStore extends Object implements TripleStore
Author:
Miora Vedelago <miora.ralambotiana at rte-france.com>
  • Constructor Details

    • EmptyTripleStore

      public EmptyTripleStore()
  • Method Details

    • read

      public void read(InputStream is, String base, String contextName)
      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 interface TripleStore
      Parameters:
      is - input stream containing statements that will be added to the Triplestore
      base - 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
      Specified by:
      write in interface TripleStore
      Parameters:
      ds - the output data source
    • 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).
      Specified by:
      print in interface TripleStore
      Parameters:
      out - output stream where the summary will be written
    • print

      public void print(Consumer<String> liner)
      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 interface TripleStore
      Parameters:
      liner - a function that accepts strings (the lines of the summary report)
    • clear

      public void clear(String contextName)
      Description copied from interface: TripleStore
      Delete all the statements in a given context.
      Specified by:
      clear in interface TripleStore
      Parameters:
      contextName - the context to be cleared
    • defineQueryPrefix

      public void defineQueryPrefix(String prefix, String namespace)
      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 interface TripleStore
      Parameters:
      prefix - the prefix to be used in the text of queries as a replacement for the namespace
      namespace - the URL of the namespace
    • query

      public PropertyBags query(String query)
      Description copied from interface: TripleStore
      Perform a SPARQL query on the Triplestore.
      Specified by:
      query in interface 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(String contextName, String namespace, String type, PropertyBags objects)
      Description copied from interface: TripleStore
      Add to the triple store statements for creating new resources, instances of a specific class
      Specified by:
      add in interface TripleStore
      Parameters:
      contextName - context where the statements are added
      namespace - the namespace of the class of the new resources
      type - the class of the new resources
      objects - properties of the resources
    • add

      public String add(String contextName, String namespace, String type, PropertyBag properties)
      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 interface TripleStore
      Parameters:
      contextName - the context where the statements are added
      namespace - the namespace of the class of the new resource
      type - the class of the new resource
      properties - properties of the resource
      Returns:
      the id of the new resource
    • add

      public void add(TripleStore source)
      Description copied from interface: TripleStore
      Add all statements of the source Triplestore to this Triplestore.
      Specified by:
      add in interface TripleStore
      Parameters:
      source - the Triplestore containing statements to be added to this Triplestore
    • contextNames

      public Set<String> contextNames()
      Description copied from interface: TripleStore
      Get all the context names currently defined in the Triplestore.
      Specified by:
      contextNames in interface TripleStore
      Returns:
      a set of all context names
    • update

      public void update(String queryText)
      Description copied from interface: TripleStore
      Perform a SPARQL update on the Triplestore.
      Specified by:
      update in interface TripleStore
      Parameters:
      queryText - the text of the query, written in SPARQL Update language
    • addNamespace

      public void addNamespace(String prefix, String namespace)
      Description copied from interface: TripleStore
      Add a namespace to the triple store
      Specified by:
      addNamespace in interface TripleStore
      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
      Specified by:
      getNamespaces in interface TripleStore
      Returns:
      the list of namespaces defined in the triple store
    • getImplementationName

      public String getImplementationName()
      Description copied from interface: TripleStore
      Return the implementation name defined in the triple store
      Specified by:
      getImplementationName in interface TripleStore
      Returns:
      the string implementation name of the triplestore object