org.eaglei.search.provider.rdf
Class AbstractRDFProvider

java.lang.Object
  extended by org.eaglei.search.provider.rdf.AbstractRDFProvider
All Implemented Interfaces:
org.eaglei.search.provider.SearchProvider
Direct Known Subclasses:
RDFModelProvider, RepositoryHarvester, SPARQLProtocolProvider

public abstract class AbstractRDFProvider
extends java.lang.Object
implements org.eaglei.search.provider.SearchProvider

SearchProvider implementation for an RDF repository. Maps a SearchRequest into a SPARQL query and converts the SPARQL ResultSet into SearchResults.

Author:
rfrost

Field Summary
protected  org.eaglei.model.EIOntModel eagleiOntModel
           
protected  org.eaglei.model.EIEntity institution
           
protected static java.lang.String OBJECT
           
protected static java.lang.String OBJECT_LABEL
           
protected static java.lang.String OBJECT_TYPE
           
protected static java.lang.String PREDICATE
           
protected  java.util.List<org.eaglei.model.EIURI> prefLabelProperties
           
protected  RepositoryConfig repoConfig
           
protected static java.lang.String SUBJECT
           
 
Constructor Summary
AbstractRDFProvider(org.eaglei.model.EIOntModel eagleiOntModel, org.eaglei.model.EIEntity institution, RepositoryConfig repoConfig)
          Creates a new SearchProvider that executes SPARQL queries against an underlying RDF repository.
 
Method Summary
 org.eaglei.search.provider.SearchCounts count(org.eaglei.search.provider.SearchCountRequest request)
           
protected  org.eaglei.search.provider.SearchResult createSearchResultFromModel(java.lang.String uri, com.hp.hpl.jena.rdf.model.Model model)
          Creates a SearchResult from an Model holding only RDF triples associated with that subject URI
protected  org.eaglei.search.provider.SearchResultSet createSearchResultSet(java.util.List<org.eaglei.search.provider.SearchResult> results, org.eaglei.search.provider.SearchRequest request)
           
static java.lang.String createSPARQLString(org.eaglei.search.provider.SearchRequest request)
          Create a SPARQL SELECT query against the repository as an ARQ Query.
 org.eaglei.model.EIEntity getInstitution()
           
protected abstract  com.hp.hpl.jena.query.QueryExecution getQueryExecution(com.hp.hpl.jena.query.Query query)
          Gets an ARQ QueryExecution for the Query.
protected  java.util.List<org.eaglei.search.provider.SearchResult> getSearchResultsFromSPARQLResults(java.util.List<com.hp.hpl.jena.query.QuerySolution> solns, org.eaglei.search.provider.SearchRequest request)
           
 void init()
           
 org.eaglei.search.provider.SearchResultSet query(org.eaglei.search.provider.SearchRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBJECT

protected static final java.lang.String SUBJECT
See Also:
Constant Field Values

PREDICATE

protected static final java.lang.String PREDICATE
See Also:
Constant Field Values

OBJECT

protected static final java.lang.String OBJECT
See Also:
Constant Field Values

OBJECT_LABEL

protected static final java.lang.String OBJECT_LABEL
See Also:
Constant Field Values

OBJECT_TYPE

protected static final java.lang.String OBJECT_TYPE
See Also:
Constant Field Values

eagleiOntModel

protected final org.eaglei.model.EIOntModel eagleiOntModel

prefLabelProperties

protected java.util.List<org.eaglei.model.EIURI> prefLabelProperties

institution

protected final org.eaglei.model.EIEntity institution

repoConfig

protected final RepositoryConfig repoConfig
Constructor Detail

AbstractRDFProvider

public AbstractRDFProvider(org.eaglei.model.EIOntModel eagleiOntModel,
                           org.eaglei.model.EIEntity institution,
                           RepositoryConfig repoConfig)
Creates a new SearchProvider that executes SPARQL queries against an underlying RDF repository.

Method Detail

init

public void init()
          throws java.io.IOException
Specified by:
init in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

getInstitution

public org.eaglei.model.EIEntity getInstitution()

query

public org.eaglei.search.provider.SearchResultSet query(org.eaglei.search.provider.SearchRequest request)
                                                 throws java.io.IOException
Specified by:
query in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

count

public org.eaglei.search.provider.SearchCounts count(org.eaglei.search.provider.SearchCountRequest request)
                                              throws java.io.IOException
Specified by:
count in interface org.eaglei.search.provider.SearchProvider
Throws:
java.io.IOException

createSPARQLString

public static java.lang.String createSPARQLString(org.eaglei.search.provider.SearchRequest request)
Create a SPARQL SELECT query against the repository as an ARQ Query.

Parameters:
request - The SearchRequest
Returns:
SPARQL Query String.

getQueryExecution

protected abstract com.hp.hpl.jena.query.QueryExecution getQueryExecution(com.hp.hpl.jena.query.Query query)
Gets an ARQ QueryExecution for the Query.

Parameters:
query - Query
Returns:
QueryExecution

getSearchResultsFromSPARQLResults

protected java.util.List<org.eaglei.search.provider.SearchResult> getSearchResultsFromSPARQLResults(java.util.List<com.hp.hpl.jena.query.QuerySolution> solns,
                                                                                                    org.eaglei.search.provider.SearchRequest request)

createSearchResultFromModel

protected org.eaglei.search.provider.SearchResult createSearchResultFromModel(java.lang.String uri,
                                                                              com.hp.hpl.jena.rdf.model.Model model)
Creates a SearchResult from an Model holding only RDF triples associated with that subject URI

Returns:
SearchResult or null if it could not be created.

createSearchResultSet

protected org.eaglei.search.provider.SearchResultSet createSearchResultSet(java.util.List<org.eaglei.search.provider.SearchResult> results,
                                                                           org.eaglei.search.provider.SearchRequest request)


Copyright © 2009-2010 Eagle-I. All Rights Reserved.