Class RDFServiceVirtuoso
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
-
- edu.cornell.mannlib.vitro.webapp.rdfservice.impl.virtuoso.RDFServiceVirtuoso
-
- All Implemented Interfaces:
RDFService
public class RDFServiceVirtuoso extends RDFServiceSparql
For now, at least, it is just like an RDFServiceSparql except: A username and password are required. These should refer to a Virtuoso user that posesses the SPARQL_UPDATE role. The endpoint URI and the update endpoint URI are derived from the base URI. You provide: http://localhost:8890 endpoint is: http://localhost:8890/sparql/ update is: http://localhost:8890/DAV/home/username/rdf_sink/vitro_update A change in the syntax of an UPDATE request: "INSERT DATA" becomes "INSERT". This fixes a problem with inserting blank nodes. The HTTP request is equipped with the username and password, to answer a challenge for basic authentication. Allow for the nonNegativeInteger bug when checking to see whether a graph has changed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
RDFService.ModelSerializationFormat, RDFService.ResultFormat, RDFService.SPARQLQueryType
-
-
Field Summary
-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
httpClient, readEndpointURI, rebuildGraphURICache, updateEndpointURI
-
Fields inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
defaultWriteGraphURI, registeredJenaListeners, registeredListeners
-
-
Constructor Summary
Constructors Constructor Description RDFServiceVirtuoso(String baseURI, String username, String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecuteUpdate(String updateString)protected org.apache.http.auth.UsernamePasswordCredentialsgetCredentials()booleanisEquivalentGraph(String graphURI, InputStream serializedGraph, RDFService.ModelSerializationFormat serializationFormat)Virtuoso has a bug which it shares with TDB: if given a literal of type xsd:nonNegativeInteger, it stores a literal of type xsd:integer.booleanisEquivalentGraph(String graphURI, org.apache.jena.rdf.model.Model graph)TDB has a bug: if given a literal of type xsd:nonNegativeInteger, it stores a literal of type xsd:integer.-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.sparql.RDFServiceSparql
changeSetUpdate, close, getContext, getDefaultWriteGraphURI, getGraphMetadata, getGraphURIs, getReadEndpointURI, getUpdateEndpointURI, isPreconditionSatisfied, manufactureChangeSet, preferPreciseOptionals, registerListener, serializeAll, serializeGraph, sparqlAskQuery, sparqlConstructQuery, sparqlConstructQuery, sparqlDescribeQuery, sparqlSelectQuery, sparqlSelectQuery, sparqlSelectQueryHasResults, testConnection, unregisterListener
-
Methods inherited from class edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceImpl
countTriples, createQuery, getRegisteredJenaModelChangedListeners, getRegisteredListeners, getSerializationFormatString, getTriples, getVitroRequest, newIndividual, newIndividual, notifyListeners, notifyListenersOfChanges, notifyListenersOfEvent, pyString, registerJenaModelChangedListener, separateStatementsWithBlankNodes, setVitroRequest, sparqlNode, sparqlNodeUpdate, sparqlTriple, toString, unregisterJenaModelChangedListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService
countTriples, getTriples, getVitroRequest, newIndividual, newIndividual, registerJenaModelChangedListener, setVitroRequest, unregisterJenaModelChangedListener
-
-
-
-
Method Detail
-
executeUpdate
protected void executeUpdate(String updateString) throws RDFServiceException
- Overrides:
executeUpdatein classRDFServiceSparql- Throws:
RDFServiceException
-
getCredentials
protected org.apache.http.auth.UsernamePasswordCredentials getCredentials()
- Overrides:
getCredentialsin classRDFServiceSparql
-
isEquivalentGraph
public boolean isEquivalentGraph(String graphURI, InputStream serializedGraph, RDFService.ModelSerializationFormat serializationFormat) throws RDFServiceException
Virtuoso has a bug which it shares with TDB: if given a literal of type xsd:nonNegativeInteger, it stores a literal of type xsd:integer. To determine whether this serialized graph is equivalent to what is already in Virtuoso, we need to do the same.- Specified by:
isEquivalentGraphin interfaceRDFService- Overrides:
isEquivalentGraphin classRDFServiceSparql- 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
TDB has a bug: if given a literal of type xsd:nonNegativeInteger, it stores a literal of type xsd:integer. To determine whether this serialized graph is equivalent to what's in TDB, we need to do the same.- Specified by:
isEquivalentGraphin interfaceRDFService- Overrides:
isEquivalentGraphin classRDFServiceSparql- 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
-
-