|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.weblab.core.helper.impl.JenaResourceHelper
public class JenaResourceHelper
This is an implementation of the ResourceHelper. It loads every Annotations that are on this object and in the inner
Resources. If the loaded Resource is an Annotation, its content won't be loaded.
| Field Summary | |
|---|---|
protected BackEndJenaHelper |
bejh
An handler for the Jena model behind. |
protected org.ow2.weblab.core.model.Resource |
resource
The current Resource object loaded. |
protected java.util.Map<java.lang.String,org.ow2.weblab.core.model.Resource> |
resourcesMap
Map to remember the mapping between sub-resources and resource URIs |
| Constructor Summary | |
|---|---|
JenaResourceHelper()
|
|
| Method Summary | ||
|---|---|---|
protected void |
addComposedQuery(org.ow2.weblab.core.model.ComposedQuery cq)
|
|
protected void |
addComposedResource(org.ow2.weblab.core.model.ComposedResource rc)
|
|
protected void |
addDocument(org.ow2.weblab.core.model.Document cu)
|
|
protected void |
addMediaUnit(org.ow2.weblab.core.model.MediaUnit mu)
|
|
protected void |
addPieceOfKnowledge(org.ow2.weblab.core.model.PieceOfKnowledge pok)
|
|
protected void |
addResource(org.ow2.weblab.core.model.Resource res)
Method recursively called to add every resources in the model and in the map. |
|
protected void |
addResultSet(org.ow2.weblab.core.model.ResultSet rs)
|
|
protected void |
addSimilarityQuery(org.ow2.weblab.core.model.SimilarityQuery sq)
|
|
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()
|
|
org.ow2.weblab.core.model.Resource |
getResource()
|
|
org.ow2.weblab.core.model.Resource |
getResource(java.lang.String uri)
|
|
java.util.List<java.lang.String> |
getRessOnPredSubj(java.lang.String uriSubj,
java.lang.String uriPred)
|
|
|
getSpecificResource(java.lang.String uri,
java.lang.Class<T> specificClass)
|
|
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)
|
|
java.lang.Class<? extends org.ow2.weblab.core.model.Resource> |
getType(java.lang.String uri)
|
|
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. |
|
boolean |
isFullyDefinedResource(java.lang.String uri)
|
|
void |
loadFromRdfXml(java.lang.String rdfXml)
Loads an RDF/XML String, to be queried. |
|
protected void |
loadFromRdfXml(java.lang.String rdfXml,
boolean add)
|
|
void |
setResource(org.ow2.weblab.core.model.Resource resource)
Fixes the current Resource that is manipulated by the helper. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.ow2.weblab.core.model.Resource resource
Resource object loaded.
protected java.util.Map<java.lang.String,org.ow2.weblab.core.model.Resource> resourcesMap
protected BackEndJenaHelper bejh
| Constructor Detail |
|---|
public JenaResourceHelper()
| Method Detail |
|---|
public org.ow2.weblab.core.model.Resource getResource(java.lang.String uri)
throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
getResource in interface ResourceHelperuri - The URI of a Resource that must be defined in RDF statements and in the Resource tree.
Resource, which is a sub-resource of the Resource behind this helper, and that its URI is uri.
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If uri is not a valid Resource and a defined URI in RDF.
public <T extends org.ow2.weblab.core.model.Resource> T getSpecificResource(java.lang.String uri,
java.lang.Class<T> specificClass)
throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
getSpecificResource in interface ResourceHelperT - The real class of the Resource to load.uri - The URI of a Resource that must be defined in RDF statements and in the Resource tree.specificClass - The class of the Resource represented by uri.
Resource, which is a sub-resource of the Resource behind this helper, and that its URI is uri.
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If uri is not a valid Resource and a defined URI in RDF.
public java.lang.Class<? extends org.ow2.weblab.core.model.Resource> getType(java.lang.String uri)
throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
getType in interface ResourceHelperuri - The URI of a Resource that must be defined in RDF statements and in the Resource tree.
class of the Resource represented by uri.
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If uri is not a valid Resource and a defined URI in RDF.public void setResource(org.ow2.weblab.core.model.Resource resource)
ResourceHelperResource that is manipulated by the helper.resource to load every Annotation that are present in its Resource tree.
setResource in interface ResourceHelperresource - The Resource to be considered by this helper.protected void addResource(org.ow2.weblab.core.model.Resource res)
res - The resource to add.protected void addSimilarityQuery(org.ow2.weblab.core.model.SimilarityQuery sq)
sq - The similarity query to add.protected void addComposedQuery(org.ow2.weblab.core.model.ComposedQuery cq)
cq - The composed unit to add.protected void addComposedResource(org.ow2.weblab.core.model.ComposedResource rc)
rc - The resourceCollection to add.protected void addResultSet(org.ow2.weblab.core.model.ResultSet rs)
rs - The resultSet to add.protected void addPieceOfKnowledge(org.ow2.weblab.core.model.PieceOfKnowledge pok)
a - The pok to add.protected void addMediaUnit(org.ow2.weblab.core.model.MediaUnit mu)
mu - The mediaUnit to add.protected void addDocument(org.ow2.weblab.core.model.Document cu)
cu -
public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
java.lang.String uriPred)
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.
List containing values of every literal that are object of statements having uriPred as predicate and
uriSubj as subject in the PieceOfKnowledge.public java.util.Set<java.lang.String> getPredsOnSubj(java.lang.String uriSubj)
uriSubj - The URI of the subject resource.
Set containing URIs of every named resources that are predicate of any statement having uriSubj as subject in the
PieceOfKnowledge.
public java.util.List<java.lang.String> getRessOnPredSubj(java.lang.String uriSubj,
java.lang.String uriPred)
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.
List containing URIs of every named resources that are object of statements having uriPred as predicate and
uriSubj as subject in the PieceOfKnowledge.public java.util.Set<java.lang.String> getSubjs()
Set containing URIs of every named resources that are subject of any statement in the PieceOfKnowledge.public java.util.Set<java.lang.String> getSubjsOnPred(java.lang.String uriPred)
uriPred - The URI of the predicate resource.
Set containing URIs of every named resources that are subject of statements having uriPred as predicate in the
PieceOfKnowledge.
public java.util.Set<java.lang.String> getSubjsOnPredLit(java.lang.String uriPred,
java.lang.String litObj)
uriPred - The URI of the predicate resource.litObj - The literal value of the object.
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.
public java.util.Set<java.lang.String> getSubjsOnPredRes(java.lang.String uriPred,
java.lang.String uriObj)
uriPred - The URI of the predicate resource.uriObj - The URI of the object resource.
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.
public boolean hasLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj)
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.litObj - The literal value of the object.
PieceOfKnowledge contains at least one statement having uriSubj as subject, uriPred as
predicate and litObj as literal value of the object.
public boolean hasResStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String uriObj)
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.uriObj - The URI of the object resource.
PieceOfKnowledge contains at least one statement having uriSubj as subject, uriPred as
predicate and uriObj as URI of the object.public boolean isDefinedResource(java.lang.String uri)
PieceOfKnowledge.
uri - The URI to test existence in the PieceOfKnowledge.
true if the URI is defined as a named resource URI in the PieceOfKnowledge.
public void loadFromRdfXml(java.lang.String rdfXml)
throws org.ow2.weblab.core.extended.exception.WebLabCheckedException
String, to be queried.
rdfXml - A RDF/XML content to be loaded.
org.ow2.weblab.core.extended.exception.WebLabCheckedException - If the rdfXml is not an RDF/XML valid String.
protected void loadFromRdfXml(java.lang.String rdfXml,
boolean add)
rdfXml - An RDF/XML String to be loaded or added to teh current modeladd - Whether to add rdfXml to current model or to create a new model from scratch.public org.ow2.weblab.core.model.Resource getResource()
getResource in interface ResourceHelperResource currently handled by the helper.public boolean isFullyDefinedResource(java.lang.String uri)
isFullyDefinedResource in interface ResourceHelperuri - An URI to test existence in RDF and in loaded sub-resources.
uri represents a WebLab Resource present in Resource tree and an RDF resource.public java.util.Set<java.lang.String> getPreds()
Set containing URIs of properties that are predicate of any statement in the PieceOfKnowledge.public java.lang.String getRdfXml()
String of the current changed made.
public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String language)
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.language - The xml:lang attribute for this literal.
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||