|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.impl.empire.model.ModelImpl
info.sswap.impl.empire.model.SourceModelImpl
info.sswap.impl.empire.model.ProtocolImpl
info.sswap.impl.empire.model.RQGImpl
public abstract class RQGImpl
Implementation of RQG interface
Nested Class Summary |
---|
Nested classes/interfaces inherited from class info.sswap.impl.empire.model.ProtocolImpl |
---|
ProtocolImpl.DefaultMappingValidator<T extends SSWAPNode>, ProtocolImpl.MappingValidator<T> |
Nested classes/interfaces inherited from interface com.clarkparsia.empire.SupportsRdfId |
---|
com.clarkparsia.empire.SupportsRdfId.BNodeKey, com.clarkparsia.empire.SupportsRdfId.RdfKey<T>, com.clarkparsia.empire.SupportsRdfId.URIKey |
Field Summary | |
---|---|
private static java.lang.String |
DEFAULT_DISCOVERY_SERVER
The default URL of the discovery server that is used when the system property did not specify one. |
private static java.lang.String |
DISCOVERY_SERVER_PROPERTY_NAME
The name of the system property that is used to retrieve the URI of the discovery server. |
private static int |
QUERY_INDENT
The width of the indentation in the generated SPARQL query. |
private boolean |
resourceValidationEnabled
|
Fields inherited from class info.sswap.impl.empire.model.SourceModelImpl |
---|
SSWAP_ONTOLOGY_URI |
Constructor Summary | |
---|---|
RQGImpl()
|
Method Summary | |
---|---|
java.util.Collection<java.lang.String> |
executeQuery(com.hp.hpl.jena.rdf.model.Model... models)
Creates and executes a SPARQL query that determines which RDGs match this RQG. |
private java.lang.String |
generateRegexRestriction(java.lang.String varName,
int indent,
java.lang.String propertyName,
java.lang.String propertyValueVar,
java.lang.Object propertyValueRestriction)
|
private java.lang.String |
generateRestriction(java.lang.String varName,
int indent,
java.lang.String propertyName,
java.lang.String propertyValueVar,
java.lang.Object propertyValueRestriction)
|
private java.lang.String |
generateSubClassRestriction(int indentLevel,
java.lang.String var,
SSWAPIndividual individual)
Generates a restriction that the type of matched individuals is a subclass of the types of the specified individual |
private java.lang.String |
generateSubjectRestriction(int indentLevel,
java.lang.String var,
SSWAPSubject subject)
Creates the part of the query that matches the RQG's subject with RDGs' subjects. |
private java.lang.String |
getDefaultDiscoveryServerURL()
|
java.lang.String |
getGraphType()
Gets the human readable name of the particular graph implementation (e.g., RDG, RQG, RIG, RRG) This method is mostly provided to generate meaningful messages in exceptions (rather than to include class name, which may not be familiar to most users) |
protected ProtocolImpl.MappingValidator<SSWAPObject> |
getObjectMappingValidator()
|
java.lang.String |
getQuery()
Gets a SPARQL query that can be executed over a model containing RDGs to determine which RDGs match this RQG. |
protected ProtocolImpl.MappingValidator<SSWAPResource> |
getResourceMappingValidator()
|
protected ProtocolImpl.MappingValidator<SSWAPSubject> |
getSubjectMappingValidator()
|
private static java.lang.String |
indent(int level)
Utility method that generates the desired inddentation level (consisting of spaces). |
java.util.Collection<RDG> |
invoke()
Sends this RQG as a query to the default Discovery Server |
java.util.Collection<RDG> |
invoke(java.net.URI discoveryServerURIString)
Sends this RQG as a query to the specified discovery server instance. |
boolean |
isResourceValidationEnabled()
|
protected boolean |
needsClosedWorldForValidation()
|
boolean |
needsDefaultParametersSet()
Returns information whether this object needs default values of parameters set during validation against RDG (i.e., default values for sswap:Resource or sswap:Subject). |
private java.lang.String |
querySafe(java.lang.String value)
|
boolean |
satisfiesResource(RDG rdg)
Checks whether this RQG matches the given RDG |
void |
setResourceValidationEnabled(boolean resourceValidationEnabled)
|
boolean |
validatesResourceURIMatch()
|
Methods inherited from class info.sswap.impl.empire.model.ProtocolImpl |
---|
anonymizeSSWAPNodes, closeWorld, createCopyObject, createGraph, createObject, createObject, createResource, createSubject, createSubject, dereference, doClosure, getGraph, getMappings, getObject, getObjectMappings, getPattern, getProvider, getResource, getResources, getSubject, getSubjectMappings, getTranslationMap, isMultiGraphs, isPattern, serialize, setMatchingGraphs, supportsTranslation, uncloseWorld, validate, validate, validateAgainstRDG, validatesObjects |
Methods inherited from class info.sswap.impl.empire.model.ModelImpl |
---|
assertModel, assertSourceModel, getAllDependentObjects, getDependentObject, getDocument, getExpressivity, getInputStream, getSourceModel, getTypeSignature, getURI, hasSourceModel, hasSourceModelWithEntityManager, isDereferenced, rdfIdEquals, rdfIdHashCode, refreshSiblings, setDereferenced, setSourceModel, setURI |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface info.sswap.api.model.SSWAPProtocol |
---|
createGraph, createObject, createObject, createSubject, createSubject, getMappings, getProvider, getResource, isMultiGraphs, isPattern |
Methods inherited from interface info.sswap.api.model.SSWAPDocument |
---|
createAnonymousDatatype, createAnonymousType, createIndividual, createIndividual, createIntersectionOf, createList, createLiteral, createTypedLiteral, createUnionOf, getDatatype, getPredicate, getType, newIndividual, newIndividual |
Methods inherited from interface info.sswap.api.model.SSWAPModel |
---|
addImport, checkProfile, dereference, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, getURI, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix, validate |
Methods inherited from interface info.sswap.impl.empire.model.SourceModel |
---|
isDereferenced |
Methods inherited from interface com.clarkparsia.empire.SupportsRdfId |
---|
getRdfId, setRdfId |
Field Detail |
---|
private static final java.lang.String DISCOVERY_SERVER_PROPERTY_NAME
private static final java.lang.String DEFAULT_DISCOVERY_SERVER
private static final int QUERY_INDENT
private boolean resourceValidationEnabled
Constructor Detail |
---|
public RQGImpl()
Method Detail |
---|
public java.lang.String getQuery()
RQG
getQuery
in interface RQG
private java.lang.String querySafe(java.lang.String value)
private java.lang.String generateRestriction(java.lang.String varName, int indent, java.lang.String propertyName, java.lang.String propertyValueVar, java.lang.Object propertyValueRestriction)
private java.lang.String generateRegexRestriction(java.lang.String varName, int indent, java.lang.String propertyName, java.lang.String propertyValueVar, java.lang.Object propertyValueRestriction)
public java.util.Collection<java.lang.String> executeQuery(com.hp.hpl.jena.rdf.model.Model... models)
RQG
executeQuery
in interface RQG
models
- models containing RDGs, their closures and inferred statements
private static java.lang.String indent(int level)
level
- the indentation level
private java.lang.String generateSubjectRestriction(int indentLevel, java.lang.String var, SSWAPSubject subject)
indentLevel
- the base indentation level for the generated restriction (so that it lines up with other conditions
on the same logical level)var
- the variable used to bind the subject in the encompassing querysubject
- the SSWAPSubject for the RQG
private java.lang.String generateSubClassRestriction(int indentLevel, java.lang.String var, SSWAPIndividual individual)
indentLevel
- the base indentation level of the generated restriction (so that it lines up with other parts
of the query at the same logical level of nesting)var
- the variable used to match the individualindividual
- the individual whose types should be included in the restriction
public java.util.Collection<RDG> invoke() throws java.io.IOException, DataAccessException
RQG
invoke
in interface RQG
java.io.IOException
- if an I/O error should occur
DataAccessException
- if there is a problem retrieving/reading RDGs for the services returned by the discovery serverpublic java.util.Collection<RDG> invoke(java.net.URI discoveryServerURIString) throws java.io.IOException, DataAccessException
RQG
invoke
in interface RQG
discoveryServerURIString
- the URI of the Discovery Server query end-point (may be null; in such a case, the default DS will be used)
java.io.IOException
- if an I/O error should occur
DataAccessException
- if there is a problem retrieving/reading RDGs for the services returned by the discovery serverprivate java.lang.String getDefaultDiscoveryServerURL()
public java.lang.String getGraphType()
ProtocolImpl
getGraphType
in class ProtocolImpl
protected boolean needsClosedWorldForValidation()
needsClosedWorldForValidation
in class ProtocolImpl
public boolean satisfiesResource(RDG rdg)
RQG
satisfiesResource
in interface RQG
rdg
- the RDG
public boolean validatesResourceURIMatch()
validatesResourceURIMatch
in class ProtocolImpl
public boolean needsDefaultParametersSet()
ProtocolImpl
needsDefaultParametersSet
in class ProtocolImpl
protected ProtocolImpl.MappingValidator<SSWAPResource> getResourceMappingValidator()
getResourceMappingValidator
in class ProtocolImpl
public void setResourceValidationEnabled(boolean resourceValidationEnabled)
public boolean isResourceValidationEnabled()
protected ProtocolImpl.MappingValidator<SSWAPSubject> getSubjectMappingValidator()
getSubjectMappingValidator
in class ProtocolImpl
protected ProtocolImpl.MappingValidator<SSWAPObject> getObjectMappingValidator()
getObjectMappingValidator
in class ProtocolImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |