info.sswap.api.model
Interface RQG

All Superinterfaces:
SSWAPDocument, SSWAPModel, SSWAPProtocol
All Known Implementing Classes:
RQGImpl

public interface RQG
extends SSWAPProtocol

A Resource Query Graph (RQG) is a specialized query sent to a Discovery Server in request of all SSWAP semantic web services (RDGs) that satisfy the query. The query is interpreted to mean: "Get me all resources such that:"

Every type (OWL Class) is a sub-type and super-type (subclass and superclass, respectively) of itself, so the above includes type equivalency.

Unlike other SSWAP Protocol graphs which have a SSWAPResorce set as a dereferencable URI of the resource on the web, an RQG may have a SSWAPResource of:

regex URIs must be of the form urn:sswap:regex:<regex> where <regex> is a SPARQL regex expression (see XQuery 1.0 and XPath 2.0 Functions and Operators).

For more on the protocol, see SSWAP Protocol.

Author:
Blazej Bulka , Damian Gessler
See Also:
PDG, RDG, RIG, RRG

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.
 java.lang.String getQuery()
          Gets a SPARQL query that can be executed over a model containing RDGs to determine which RDGs match this RQG.
 java.util.Collection<RDG> invoke()
          Sends this RQG as a query to the default Discovery Server
 java.util.Collection<RDG> invoke(java.net.URI discoveryServerURI)
          Sends this RQG as a query to the specified discovery server instance.
 boolean satisfiesResource(RDG rdg)
          Checks whether this RQG matches the given RDG
 
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
 

Method Detail

getQuery

java.lang.String getQuery()
Gets a SPARQL query that can be executed over a model containing RDGs to determine which RDGs match this RQG. The model containing RDGs should contain inferred facts for these models (i.e., it should be either a model that contains previously computed inferences, or be backed by a reasoner to compute them dynamically; e.g., an OntModel). Additionally, the execution environment for the query should take into account the inferred facts for this RQG.

Returns:
the SPARQL query.

executeQuery

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. The query is executed over (potentially) multiple models that contain closures and inferred statements about the RDGs. The implementation of this method will also take into account the closure and inferred statements about this RQG when executiong the query.

Parameters:
models - models containing RDGs, their closures and inferred statements
Returns:
a collection of URIs of matching RDGs

invoke

java.util.Collection<RDG> invoke(java.net.URI discoveryServerURI)
                                 throws java.io.IOException,
                                        DataAccessException
Sends this RQG as a query to the specified discovery server instance.

Parameters:
discoveryServerURI - the URI of the Discovery Server query end-point (may be null; in such a case, the default DS will be used)
Returns:
the collection of RDGs matching the query
Throws:
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 server

invoke

java.util.Collection<RDG> invoke()
                                 throws java.io.IOException,
                                        DataAccessException
Sends this RQG as a query to the default Discovery Server

Returns:
the collection of RDGs matching the query
Throws:
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 server

satisfiesResource

boolean satisfiesResource(RDG rdg)
Checks whether this RQG matches the given RDG

Parameters:
rdg - the RDG
Returns:
true if this RQG matches the given RDG, false otherwise


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.