org.ow2.weblab.core.helper.impl
Class JenaSingleResourceHelperExtended

java.lang.Object
  extended by org.ow2.weblab.core.helper.impl.JenaResourceHelper
      extended by org.ow2.weblab.core.helper.impl.JenaResourceHelperExtended
          extended by org.ow2.weblab.core.helper.impl.JenaSingleResourceHelperExtended
All Implemented Interfaces:
ResourceHelper, ResourceHelperExtended

public class JenaSingleResourceHelperExtended
extends JenaResourceHelperExtended

This is the simplest implementation of the ResourceHelperExtended. It only loads every Annotations that are on this object. No crawling of the Resource. If the loaded Resource is an Annotation, its content won't be loaded.

Author:
EADS WebLab Team
To do:
Prevent the direct instantiation of this class.
Date:
2008-11-25

Field Summary
 
Fields inherited from class org.ow2.weblab.core.helper.impl.JenaResourceHelper
bejh, resource, resourcesMap
 
Constructor Summary
JenaSingleResourceHelperExtended()
           
 
Method Summary
protected  void addResource(org.ow2.weblab.core.model.Resource res)
          Method recursively called to add every resources in the model and in the map.
 java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred)
           
 java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String language)
           
 java.util.Set<java.lang.String> getPreds()
           
 java.util.Set<java.lang.String> getPredsOnSubj(java.lang.String uriSubj)
           
 java.lang.String getRdfXml()
           
 java.util.List<java.lang.String> getRessOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred)
           
 java.util.Set<java.lang.String> getSubjs()
           
 java.util.Set<java.lang.String> getSubjsOnPred(java.lang.String uriPred)
           
 java.util.Set<java.lang.String> getSubjsOnPredLit(java.lang.String uriPred, java.lang.String litObj)
           
 java.util.Set<java.lang.String> getSubjsOnPredRes(java.lang.String uriPred, java.lang.String uriObj)
           
 boolean hasLitStat(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String litObj)
           
 boolean hasResStat(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String uriObj)
           
 boolean isDefinedResource(java.lang.String uri)
          Tests if the given URI is defined as a named resource in the PieceOfKnowledge.
 void loadFromRdfXml(java.lang.String rdfXml)
          Loads an RDF/XML String, to be queried.
 
Methods inherited from class org.ow2.weblab.core.helper.impl.JenaResourceHelperExtended
getAnonReifStats, getAnonResOfAnonReifStat, getAnonResOnReifStat, getAnonRessOnPredAnonResStatReif, getAnonRessOnPredAnonResStatReifOnAnonSubj, getAnonRessOnPredAnonStatReif, getAnonRessOnPredAnonSubj, getAnonRessOnPredLitStatReif, getAnonRessOnPredLitStatReifOnAnonSubj, getAnonRessOnPredResStatReif, getAnonRessOnPredResStatReifOnAnonSubj, getAnonRessOnPredStatReif, getAnonRessOnPredSubj, getAnonSubjOfAnonReifStat, getAnonSubjOfReifStat, getAnonSubjs, getAnonSubjsOnPred, getAnonSubjsOnPredAnonRes, getAnonSubjsOnPredLit, getAnonSubjsOnPredRes, getLitOfAnonReifStat, getLitOfReifStat, getLitsOnPredAnonResStatReif, getLitsOnPredAnonResStatReifOnAnonSubj, getLitsOnPredAnonStatReif, getLitsOnPredAnonSubj, getLitsOnPredLitStatReif, getLitsOnPredLitStatReifOnAnonSubj, getLitsOnPredResStatReif, getLitsOnPredResStatReifOnAnonSubj, getLitsOnPredStatReif, getNSPrefixes, getPredOfAnonReifStat, getPredOfReifStat, getPredsOnAnonResStatReif, getPredsOnAnonResStatReifOnAnonSubj, getPredsOnAnonStatReif, getPredsOnAnonSubj, getPredsOnLitStatReif, getPredsOnLitStatReifOnAnonSubj, getPredsOnResStatReif, getPredsOnResStatReifOnAnonSubj, getPredsOnStatReif, getReifStats, getResOfAnonReifStat, getResOfReifStat, getRessOnPredAnonResStatReif, getRessOnPredAnonResStatReifOnAnonSubj, getRessOnPredAnonStatReif, getRessOnPredAnonSubj, getRessOnPredLitStatReif, getRessOnPredLitStatReifOnAnonSubj, getRessOnPredResStatReif, getRessOnPredResStatReifOnAnonSubj, getRessOnPredStatReif, getSubjOfAnonReifStat, getSubjOfReifStat, getSubjsOnPredAnonRes, hasAnonResStat, hasAnonResStatOnAnonSubj, hasLitStatOnAnonSubj, hasResStatOnAnonSubj, isAnonResStatReif, isAnonResStatReifOnAnonSubj, isDefinedAnonRes, isLitStatReif, isLitStatReifOnAnonSubj, isResStatReif, isResStatReifOnAnonSubj
 
Methods inherited from class org.ow2.weblab.core.helper.impl.JenaResourceHelper
addComposedQuery, addComposedResource, addDocument, addMediaUnit, addPieceOfKnowledge, addResultSet, addSimilarityQuery, getLitsOnPredSubj, getLitsOnPredSubj, getPreds, getPredsOnSubj, getRdfXml, getResource, getResource, getRessOnPredSubj, getSpecificResource, getSubjs, getSubjsOnPred, getSubjsOnPredLit, getSubjsOnPredRes, getType, hasLitStat, hasResStat, isDefinedResource, isFullyDefinedResource, loadFromRdfXml, loadFromRdfXml, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.weblab.core.helper.ResourceHelper
getResource, getResource, getSpecificResource, getType, isFullyDefinedResource, setResource
 

Constructor Detail

JenaSingleResourceHelperExtended

public JenaSingleResourceHelperExtended()
Method Detail

addResource

protected void addResource(org.ow2.weblab.core.model.Resource res)
Description copied from class: JenaResourceHelper
Method recursively called to add every resources in the model and in the map.

Overrides:
addResource in class JenaResourceHelper
Parameters:
res - The resource to add.

getRdfXml

public java.lang.String getRdfXml()
Returns:
A valid RDF/XML String of the current changed made.

loadFromRdfXml

public void loadFromRdfXml(java.lang.String rdfXml)
                    throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
Loads an RDF/XML String, to be queried.

Parameters:
rdfXml - A RDF/XML content to be loaded.
Throws:
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If the rdfXml is not an RDF/XML valid String.

getLitsOnPredSubj

public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred)
Parameters:
uriSubj - The URI of the subject resource.
uriPred - The URI of the predicate resource.
Returns:
A List containing values of every literal that are object of statements having uriPred as predicate and uriSubj as subject in the PieceOfKnowledge.

getLitsOnPredSubj

public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred,
                                                          java.lang.String language)
Parameters:
uriSubj - The URI of the subject resource.
uriPred - The URI of the predicate resource.
language - The xml:lang attribute for this literal.
Returns:
A List containing values in language language of every literal that are object of statements having uriPred as predicate and uriSubj as subject in the PieceOfKnowledge. For more information about language attribute, see http://www.w3.org/TR/REC-xml/#sec-lang-tag.

getPredsOnSubj

public java.util.Set<java.lang.String> getPredsOnSubj(java.lang.String uriSubj)
Parameters:
uriSubj - The URI of the subject resource.
Returns:
A Set containing URIs of every named resources that are predicate of any statement having uriSubj as subject in the PieceOfKnowledge.

getRessOnPredSubj

public java.util.List<java.lang.String> getRessOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred)
Parameters:
uriSubj - The URI of the subject resource.
uriPred - The URI of the predicate resource.
Returns:
A List containing URIs of every named resources that are object of statements having uriPred as predicate and uriSubj as subject in the PieceOfKnowledge.

getSubjs

public java.util.Set<java.lang.String> getSubjs()
Returns:
A Set containing URIs of every named resources that are subject of any statement in the PieceOfKnowledge.

getSubjsOnPred

public java.util.Set<java.lang.String> getSubjsOnPred(java.lang.String uriPred)
Parameters:
uriPred - The URI of the predicate resource.
Returns:
A Set containing URIs of every named resources that are subject of statements having uriPred as predicate in the PieceOfKnowledge.

getSubjsOnPredLit

public java.util.Set<java.lang.String> getSubjsOnPredLit(java.lang.String uriPred,
                                                         java.lang.String litObj)
Parameters:
uriPred - The URI of the predicate resource.
litObj - The literal value of the object.
Returns:
A Set containing URIs of every named resources that are subject of statements having uriPred as predicate and litObj as object literal value in the PieceOfKnowledge.

getSubjsOnPredRes

public java.util.Set<java.lang.String> getSubjsOnPredRes(java.lang.String uriPred,
                                                         java.lang.String uriObj)
Parameters:
uriPred - The URI of the predicate resource.
uriObj - The URI of the object resource.
Returns:
A Set containing URIs of every named resources that are subject of statements having uriPred as predicate and uriObj as object named resource URI in the PieceOfKnowledge.

hasLitStat

public boolean hasLitStat(java.lang.String uriSubj,
                          java.lang.String uriPred,
                          java.lang.String litObj)
Parameters:
uriSubj - The URI of the subject resource.
uriPred - The URI of the predicate resource.
litObj - The literal value of the object.
Returns:
Whether or not the PieceOfKnowledge contains at least one statement having uriSubj as subject, uriPred as predicate and litObj as literal value of the object.

hasResStat

public boolean hasResStat(java.lang.String uriSubj,
                          java.lang.String uriPred,
                          java.lang.String uriObj)
Parameters:
uriSubj - The URI of the subject resource.
uriPred - The URI of the predicate resource.
uriObj - The URI of the object resource.
Returns:
Whether or not the PieceOfKnowledge contains at least one statement having uriSubj as subject, uriPred as predicate and uriObj as URI of the object.

isDefinedResource

public boolean isDefinedResource(java.lang.String uri)
Tests if the given URI is defined as a named resource in the PieceOfKnowledge.

Parameters:
uri - The URI to test existence in the PieceOfKnowledge.
Returns:
true if the URI is defined as a named resource URI in the PieceOfKnowledge.

getPreds

public java.util.Set<java.lang.String> getPreds()
Returns:
A Set containing URIs of properties that are predicate of any statement in the PieceOfKnowledge.


Copyright © 2004-2010. All Rights Reserved.