com.hp.hpl.swade.portal
Interface DataStore

All Known Implementing Classes:
AbstractDataStoreImpl, DataStoreDBImpl, DataStoreMemImpl, DataStoreWrapperImpl

public interface DataStore

This is abstraction for an interace onto a datastore. Each configured DataSource will have some associated datastore.

Each data store provides:

Version:
$Revision: 1.2 $ on $Date: 2004/07/04 20:30:54 $
Author:
Dave Reynolds

Method Summary
 void addData(com.hp.hpl.jena.rdf.model.Model newdata, java.lang.String url)
          Add a set of statements into the data source, reseting appropriate caches.
 void annotate(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.rdf.model.Property prop, com.hp.hpl.jena.rdf.model.RDFNode value)
          Add a single annotation to a resource.
 void annotateClassification(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.rdf.model.Property prop, com.hp.hpl.jena.rdf.model.RDFNode value)
          Add a classification annotation to a resource.
 void clearCache()
          Call to flush all caches and make sure future loads see fresh state data.
 com.hp.hpl.jena.rdf.model.Model getDataModel()
          Return the aggregated data in the store as a Jena model.
 MultiModel getDataMultiModel()
          Return the aggregated data in the store as a multi model.
 com.hp.hpl.jena.ontology.OntModel getOntologyModel()
          Return the ontology model for the data source.
 FilterQuery getRootQuery()
          Return a FilterQuery which will find all candidate root resources in this data source.
 com.hp.hpl.jena.rdf.model.Resource getStatementSource(com.hp.hpl.jena.rdf.model.Statement stmt)
          Return a resource representing the data source of the given statement or null if it is not known.
 java.util.List listCompatibleRelations(com.hp.hpl.jena.rdf.model.Resource source, com.hp.hpl.jena.rdf.model.Resource target)
          Return a list of (wrapped) properties which can be used as explicit relation links by this datasource.
 void loadData(java.io.InputStream ins, java.lang.String url, java.lang.String lang)
          Load a new block of data into the main data model.
 boolean loadKS(java.lang.String urlIn)
          Load additional additional source definitions into this source, along with any referenced sourceURLs.
 void saveAnnotations()
          Save all the annotations out to a local file.
 void updateRefinementCounts()
          Update the set of cached refinement counts.
 

Method Detail

getDataModel

public com.hp.hpl.jena.rdf.model.Model getDataModel()
Return the aggregated data in the store as a Jena model. This will include any ontology data and any transient annotations, if supported.


getDataMultiModel

public MultiModel getDataMultiModel()
Return the aggregated data in the store as a multi model. Will return null if this a wrapped simple model instead of a full data source.


getStatementSource

public com.hp.hpl.jena.rdf.model.Resource getStatementSource(com.hp.hpl.jena.rdf.model.Statement stmt)
Return a resource representing the data source of the given statement or null if it is not known. If the same statement was sourced from several locations the result will be an essentially random selection.


getOntologyModel

public com.hp.hpl.jena.ontology.OntModel getOntologyModel()
Return the ontology model for the data source. This may be the same as the raw data model.

TODO generalize to multiple source options and non-file sources.


getRootQuery

public FilterQuery getRootQuery()
Return a FilterQuery which will find all candidate root resources in this data source. It might be a null query or might involve non-trivial filtering specified in the source configuration set up.


listCompatibleRelations

public java.util.List listCompatibleRelations(com.hp.hpl.jena.rdf.model.Resource source,
                                              com.hp.hpl.jena.rdf.model.Resource target)
Return a list of (wrapped) properties which can be used as explicit relation links by this datasource. The current implementation defines such list by means of the subproperty tree rooted at a defined property. If the property has a defined domain and range then only properties compatible with the given source and target object are returned.


loadData

public void loadData(java.io.InputStream ins,
                     java.lang.String url,
                     java.lang.String lang)
Load a new block of data into the main data model. This will normalize the data by applying any local closure rules (against the ontology) and smushing any bNodes with InverseFunctionalProperties which match URIs in the full dataset.


addData

public void addData(com.hp.hpl.jena.rdf.model.Model newdata,
                    java.lang.String url)
Add a set of statements into the data source, reseting appropriate caches. This will normalize the data by applying any local closure rules (against the ontology) and smushing any bNodes with InverseFunctionalProperties which match URIs in the full dataset.


updateRefinementCounts

public void updateRefinementCounts()
Update the set of cached refinement counts. These counts are stored in the top level data base structure.


annotate

public void annotate(com.hp.hpl.jena.rdf.model.Resource resource,
                     com.hp.hpl.jena.rdf.model.Property prop,
                     com.hp.hpl.jena.rdf.model.RDFNode value)
Add a single annotation to a resource.


annotateClassification

public void annotateClassification(com.hp.hpl.jena.rdf.model.Resource resource,
                                   com.hp.hpl.jena.rdf.model.Property prop,
                                   com.hp.hpl.jena.rdf.model.RDFNode value)
Add a classification annotation to a resource.


saveAnnotations

public void saveAnnotations()
                     throws java.io.IOException
Save all the annotations out to a local file.

java.io.IOException

loadKS

public boolean loadKS(java.lang.String urlIn)
Load additional additional source definitions into this source, along with any referenced sourceURLs.

Returns:
true if succeeds

clearCache

public void clearCache()
Call to flush all caches and make sure future loads see fresh state data. TODO move to a more subtle cache policy which can handle some updates incrementally



Copyright © 2004 Hewlett-Packard. All Rights Reserved.