Interface RDFConnection

    • Method Detail

      • connect

        static RDFConnection connect​(Dataset dataset,
                                     Isolation isolation)
        Connect to a local (same JVM) dataset.

        Multiple levels of Isolation are provided, The default COPY level makes a local RDFConnection behave like a remote connection. See the documentation for more details.

        • COPYModels and Datasets are copied. This is most like a remote connection.
        • READONLY – Read-only wrappers are added but changes to the underlying model or dataset will be seen.
        • NONE (default) – Changes to the returned Models or Datasets act on the original object.
        Parameters:
        dataset -
        isolation -
        Returns:
        RDFConnection
      • queryConnect

        static RDFConnection queryConnect​(java.lang.String queryServiceURL)
        Create a connection to a remote location for SPARQL query requests
        Parameters:
        queryServiceURL -
        Returns:
        RDFConnection
      • connect

        static RDFConnection connect​(java.lang.String serviceURL)
        Create a connection to a remote location by URL. This is the URL for the dataset.

        This is the URL for the dataset. Other names can be specified using RDFConnectionRemote.newBuilder() and setting the endpoint URLs.

         RDFConnectionRemote.newBuilder()
               .queryEndpoint(queryServiceEndpoint)
               .updateEndpoint(updateServiceEndpoint)
               .gspEndpoint(graphStoreProtocolEndpoint)
               .build();
         
        Parameters:
        serviceURL -
        Returns:
        RDFConnection
      • connectPW

        static RDFConnection connectPW​(java.lang.String URL,
                                       java.lang.String user,
                                       java.lang.String password)
        Make a remote RDFConnection to the URL, with user and password for the client access using basic auth. Use with care – basic auth over plain HTTP reveals the password on the network.
        Parameters:
        URL -
        user -
        password -
        Returns:
        RDFConnection
      • queryResultSet

        default void queryResultSet​(java.lang.String queryString,
                                    java.util.function.Consumer<ResultSet> resultSetAction)
        Execute a SELECT query and process the ResultSet with the handler code.
        Specified by:
        queryResultSet in interface SparqlQueryConnection
        Parameters:
        queryString -
        resultSetAction -
      • queryResultSet

        default void queryResultSet​(Query query,
                                    java.util.function.Consumer<ResultSet> resultSetAction)
        Execute a SELECT query and process the ResultSet with the handler code.
        Specified by:
        queryResultSet in interface SparqlQueryConnection
        Parameters:
        query -
        resultSetAction -
      • querySelect

        default void querySelect​(java.lang.String queryString,
                                 java.util.function.Consumer<QuerySolution> rowAction)
        Execute a SELECT query and process the rows of the results with the handler code.
        Specified by:
        querySelect in interface SparqlQueryConnection
        Parameters:
        queryString -
        rowAction -
      • querySelect

        default void querySelect​(Query query,
                                 java.util.function.Consumer<QuerySolution> rowAction)
        Execute a SELECT query and process the rows of the results with the handler code.
        Specified by:
        querySelect in interface SparqlQueryConnection
        Parameters:
        query -
        rowAction -
      • queryAsk

        default boolean queryAsk​(java.lang.String queryString)
        Execute a ASK query and return a boolean
        Specified by:
        queryAsk in interface SparqlQueryConnection
      • update

        default void update​(java.lang.String updateString)
        Execute a SPARQL Update.
        Specified by:
        update in interface SparqlUpdateConnection
        Parameters:
        updateString -
      • fetch

        Model fetch​(java.lang.String graphName)
        Fetch a named graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.
        Specified by:
        fetch in interface RDFDatasetAccessConnection
        Parameters:
        graphName - URI string for the graph name (null or "default" for the default graph)
        Returns:
        Model
      • fetch

        Model fetch()
        Fetch the default graph. This is SPARQL Graph Store Protocol HTTP GET or equivalent.
        Specified by:
        fetch in interface RDFDatasetAccessConnection
        Returns:
        Model
      • load

        void load​(java.lang.String graphName,
                  java.lang.String file)
        Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
        Specified by:
        load in interface RDFDatasetConnection
        Parameters:
        graphName - Graph name (null or "default" for the default graph)
        file - File of the data.
      • load

        void load​(java.lang.String file)
        Load (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
        Specified by:
        load in interface RDFDatasetConnection
        Parameters:
        file - File of the data.
      • load

        void load​(java.lang.String graphName,
                  Model model)
        Load (add, append) RDF into a named graph in a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
        Specified by:
        load in interface RDFDatasetConnection
        Parameters:
        graphName - Graph name (null or "default" for the default graph)
        model - Data.
      • load

        void load​(Model model)
        Load (add, append) RDF into the default graph of a dataset. This is SPARQL Graph Store Protocol HTTP POST or equivalent.
        Specified by:
        load in interface RDFDatasetConnection
        Parameters:
        model - Data.
      • put

        void put​(java.lang.String graphName,
                 java.lang.String file)
        Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
        Specified by:
        put in interface RDFDatasetConnection
        Parameters:
        graphName - Graph name (null or "default" for the default graph)
        file - File of the data.
      • put

        void put​(java.lang.String file)
        Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
        Specified by:
        put in interface RDFDatasetConnection
        Parameters:
        file - File of the data.
      • put

        void put​(java.lang.String graphName,
                 Model model)
        Set the contents of a named graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
        Specified by:
        put in interface RDFDatasetConnection
        Parameters:
        graphName - Graph name (null or "default" for the default graph)
        model - Data.
      • put

        void put​(Model model)
        Set the contents of the default graph of a dataset. Any existing data is lost. This is SPARQL Graph Store Protocol HTTP PUT or equivalent.
        Specified by:
        put in interface RDFDatasetConnection
        Parameters:
        model - Data.
      • delete

        void delete​(java.lang.String graphName)
        Delete a graph from the dataset. Null or "default" means the default graph, which is cleared, not removed.
        Specified by:
        delete in interface RDFDatasetConnection
        Parameters:
        graphName -