Class RDFServiceFactorySingle.UnclosableRDFService

    • Constructor Detail

      • UnclosableRDFService

        public UnclosableRDFService​(RDFService rdfService)
    • Method Detail

      • changeSetUpdate

        public boolean changeSetUpdate​(ChangeSet changeSet)
                                throws RDFServiceException
        Description copied from interface: RDFService
        Performs a series of additions to and or removals from specified graphs in the RDF store. preConditionSparql is executed against the union of all the graphs in the knowledge base before any updates are made. If the precondition query returns a non-empty result, no updates are made made.
        Specified by:
        changeSetUpdate in interface RDFService
        Parameters:
        changeSet - - a set of changes to be performed on the RDF store.
        Returns:
        boolean - indicates whether the precondition was satisfied
        Throws:
        RDFServiceException
      • newIndividual

        public void newIndividual​(String individualURI,
                                  String individualTypeURI)
                           throws RDFServiceException
        Description copied from interface: RDFService
        If the given individual already exists in the default write graph, throws an RDFServiceException, otherwise adds one type assertion to the default write graph.
        Specified by:
        newIndividual in interface RDFService
        Parameters:
        individualURI - - URI of the individual to be added
        individualTypeURI - - URI of the type for the individual
        Throws:
        RDFServiceException
      • newIndividual

        public void newIndividual​(String individualURI,
                                  String individualTypeURI,
                                  String graphURI)
                           throws RDFServiceException
        Description copied from interface: RDFService
        If the given individual already exists in the given graph, throws an RDFServiceException, otherwise adds one type assertion to the given graph.
        Specified by:
        newIndividual in interface RDFService
        Parameters:
        individualURI - - URI of the individual to be added
        individualTypeURI - - URI of the type for the individual
        graphURI - - URI of the graph to which to add the individual
        Throws:
        RDFServiceException
      • sparqlConstructQuery

        public InputStream sparqlConstructQuery​(String query,
                                                RDFService.ModelSerializationFormat resultFormat)
                                         throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL construct query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlConstructQuery in interface RDFService
        Parameters:
        query - - the SPARQL query to be executed against the RDF store
        resultFormat - - type of serialization for RDF result of the SPARQL query
        Returns:
        InputStream - the result of the query
        Throws:
        RDFServiceException
      • sparqlConstructQuery

        public void sparqlConstructQuery​(String query,
                                         org.apache.jena.rdf.model.Model model)
                                  throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL construct query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlConstructQuery in interface RDFService
        Parameters:
        query - - the SPARQL query to be executed against the RDF store
        model - - the Model to add the statements to
        Throws:
        RDFServiceException
      • sparqlDescribeQuery

        public InputStream sparqlDescribeQuery​(String query,
                                               RDFService.ModelSerializationFormat resultFormat)
                                        throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL describe query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlDescribeQuery in interface RDFService
        Parameters:
        query - - the SPARQL query to be executed against the RDF store
        resultFormat - - type of serialization for RDF result of the SPARQL query
        Returns:
        InputStream - the result of the query
        Throws:
        RDFServiceException
      • sparqlSelectQuery

        public InputStream sparqlSelectQuery​(String query,
                                             RDFService.ResultFormat resultFormat)
                                      throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL select query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlSelectQuery in interface RDFService
        Parameters:
        query - - the SPARQL query to be executed against the RDF store
        resultFormat - - format for the result of the Select query
        Returns:
        InputStream - the result of the query
        Throws:
        RDFServiceException
      • sparqlSelectQuery

        public void sparqlSelectQuery​(String query,
                                      ResultSetConsumer consumer)
                               throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL select query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlSelectQuery in interface RDFService
        Parameters:
        query - - the SPARQL query to be executed against the RDF store
        consumer - - the class to consume the results of the query
        Throws:
        RDFServiceException
      • sparqlAskQuery

        public boolean sparqlAskQuery​(String query)
                               throws RDFServiceException
        Description copied from interface: RDFService
        Performs a SPARQL ASK query against the knowledge base. The query may have an embedded graph identifier. If the query does not contain a graph identifier the query is executed against the union of all named and unnamed graphs in the store.
        Specified by:
        sparqlAskQuery in interface RDFService
        Parameters:
        query - - the SPARQL ASK query to be executed against the RDF store
        Returns:
        boolean - the result of the SPARQL ASK query
        Throws:
        RDFServiceException
      • serializeAll

        public void serializeAll​(OutputStream outputStream)
                          throws RDFServiceException
        Description copied from interface: RDFService
        Serializes the union of all named and unnamed graphs in the store to the supplied OutputStream, in N-Quads format. This method is designed for exporting data from VIVO, so any filters should be bypassed. If possible, this should be done without buffering in memory, so arbitrarily large graphs can be exported.
        Specified by:
        serializeAll in interface RDFService
        Parameters:
        outputStream - - receives the serialized result.
        Throws:
        RDFServiceException
      • serializeGraph

        public void serializeGraph​(String graphURI,
                                   OutputStream outputStream)
                            throws RDFServiceException
        Description copied from interface: RDFService
        Serializes the contents of the named graph to the supplied OutputStream, in N-Triples format. This method is designed for exporting data from VIVO, so any filters should be bypassed. If possible, this should be done without buffering in memory, so arbitrarily large graphs can be exported.
        Specified by:
        serializeGraph in interface RDFService
        Parameters:
        graphURI - - the URI of the desired graph. May not be null.
        outputStream - - receives the serialized result.
        Throws:
        RDFServiceException
      • isEquivalentGraph

        public boolean isEquivalentGraph​(String graphURI,
                                         InputStream serializedGraph,
                                         RDFService.ModelSerializationFormat serializationFormat)
                                  throws RDFServiceException
        Description copied from interface: RDFService
        Tests to see whether the supplied serialization is equivalent to the named graph, as it exists in the store. Equivalence means that if this serialization were written to the store, the resulting graph would be isomorphic to the existing named graph.
        Specified by:
        isEquivalentGraph in interface RDFService
        Parameters:
        graphURI - - the URI of the graph to test against. May not be null.
        serializedGraph - - the contents to be compared with the existing graph. May not be null.
        serializationFormat - - May not be null.
        Throws:
        RDFServiceException
      • isEquivalentGraph

        public boolean isEquivalentGraph​(String graphURI,
                                         org.apache.jena.rdf.model.Model graph)
                                  throws RDFServiceException
        Description copied from interface: RDFService
        Tests to see whether the supplied serialization is equivalent to the named graph, as it exists in the store. Equivalence means that if this serialization were written to the store, the resulting graph would be isomorphic to the existing named graph.
        Specified by:
        isEquivalentGraph in interface RDFService
        Parameters:
        graphURI - - the URI of the graph to test against. May not be null.
        graph - - the contents to be compared with the existing graph. May not be null.
        Throws:
        RDFServiceException
      • registerJenaModelChangedListener

        public void registerJenaModelChangedListener​(org.apache.jena.rdf.model.ModelChangedListener changeListener)
                                              throws RDFServiceException
        Description copied from interface: RDFService
        Registers a Jena listener to listen to changes in any graph in the RDF store.
        Specified by:
        registerJenaModelChangedListener in interface RDFService
        Parameters:
        changeListener - - the change listener
        Throws:
        RDFServiceException
      • unregisterJenaModelChangedListener

        public void unregisterJenaModelChangedListener​(org.apache.jena.rdf.model.ModelChangedListener changeListener)
                                                throws RDFServiceException
        Description copied from interface: RDFService
        Unregisters a Jena listener from listening to changes in any graph in the RDF store
        Specified by:
        unregisterJenaModelChangedListener in interface RDFService
        Parameters:
        changeListener - - the change listener
        Throws:
        RDFServiceException
      • getTriples

        public org.apache.jena.rdf.model.Model getTriples​(org.apache.jena.rdf.model.RDFNode subject,
                                                          org.apache.jena.rdf.model.RDFNode predicate,
                                                          org.apache.jena.rdf.model.RDFNode object,
                                                          long limit,
                                                          long offset)
                                                   throws RDFServiceException
        Specified by:
        getTriples in interface RDFService
        Throws:
        RDFServiceException
      • close

        public void close()
        Description copied from interface: RDFService
        Frees any resources held by this RDFService object The implementation of this method should be idempotent so that multiple invocations do not cause an error.
        Specified by:
        close in interface RDFService
      • setVitroRequest

        public void setVitroRequest​(VitroRequest vitroRequest)
        Description copied from interface: RDFService
        UQAM-Bug-Correction Useful among other things to transport the linguistic context in the service
        Specified by:
        setVitroRequest in interface RDFService