|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.weblab.core.helper.impl.JenaPoKHelper
public class JenaPoKHelper
Implementation of AnnotationHelper based on Jena framework.
You'd rather to load this class using the HelperFactory.
JenaPoKHelperExtended| Field Summary | |
|---|---|
protected boolean |
autoCommit
In auto commit mode, remove and create operations are writing into pok each time they are called. |
protected BackEndJenaHelper |
bejh
The Jena model containing the RDF graph |
protected org.ow2.weblab.core.model.PieceOfKnowledge |
pok
The current Annotation object loaded |
| Constructor Summary | |
|---|---|
JenaPoKHelper()
|
|
| Method Summary | |
|---|---|
void |
commit()
A call to commit is needed when PoKHelper do not works in "autoCommitMode". |
void |
createLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj)
Creates a statement having uriSubj as subject, uriPred as predicate and litObj as literal value of the object. |
void |
createLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj,
java.lang.String language)
Creates a statement having uriSubj as subject, uriPred as predicate and litObj as literal value of the object. |
void |
createResStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String uriObj)
Creates a statement having uriSubj as subject, uriPred as predicate and uriObj as URI of the object. |
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)
|
org.ow2.weblab.core.model.PieceOfKnowledge |
getPoK()
Retrieve the current PieceOfKnowledge which is manipulated. |
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. |
void |
removeLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj)
Removes every statements having uriSubj as subject, uriPred as predicate and litObj as literal value of the
object. |
void |
removeResStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String uriObj)
Removes every statements having uriSubj as subject, uriPred as predicate and uriObj as URI of the object. |
void |
removeStatsOnSubj(java.lang.String uriSubj)
Removes every statements having uriSubj as subject whatever are predicate and object. |
void |
removeStatsWithLit(java.lang.String litObj)
Removes every statements having litObj as object literal value whatever are subject and predicate. |
void |
removeStatsWithPred(java.lang.String uriPred)
Removes every statements having uriPred as predicate whatever are subject and object. |
void |
removeStatsWithRes(java.lang.String uriObj)
Removes every statements having uriObj as object named resource URI value whatever are subject and predicate. |
void |
setAutoCommitMode(boolean autoCommitMode)
In auto commit mode, remove and create operations are writing into the PieceOfKnowledge each time they are called. |
void |
setPoK(org.ow2.weblab.core.model.PieceOfKnowledge pok)
Fixes the current PieceOfKnowledge which 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.PieceOfKnowledge pok
Annotation object loaded
protected BackEndJenaHelper bejh
protected boolean autoCommit
pok each time they are called. When performing a lot's of actions on the
RDF, best practice is to set auto commit mode to false and to commit at the end of the process.
| Constructor Detail |
|---|
public JenaPoKHelper()
| Method Detail |
|---|
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> 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> 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.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 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 void createLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj,
java.lang.String language)
uriSubj as subject, uriPred as predicate and litObj as literal value of the object.
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.litObj - The literal value of the object.language - The language of the literal value. See http://www.w3.org/TR/REC-xml/#sec-lang-tag for more information.
public void createLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj)
uriSubj as subject, uriPred as predicate and litObj as literal value of the object.
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.litObj - The literal value of the object.
public void createResStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String uriObj)
uriSubj as subject, uriPred as predicate and uriObj as URI of the object.
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.uriObj - The URI of the object resource.
public void removeLitStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String litObj)
uriSubj as subject, uriPred as predicate and litObj as literal value of the
object.
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.litObj - The literal value of the object.
public void removeResStat(java.lang.String uriSubj,
java.lang.String uriPred,
java.lang.String uriObj)
uriSubj as subject, uriPred as predicate and uriObj as URI of the object.
uriSubj - The URI of the subject resource.uriPred - The URI of the predicate resource.uriObj - The URI of the object resource.public void removeStatsOnSubj(java.lang.String uriSubj)
uriSubj as subject whatever are predicate and object.
uriSubj - The URI of the subject resource.public void removeStatsWithPred(java.lang.String uriPred)
uriPred as predicate whatever are subject and object.
uriPred - The URI of the predicate resource.public void removeStatsWithLit(java.lang.String litObj)
litObj as object literal value whatever are subject and predicate.
litObj - The literal value of the object.public void removeStatsWithRes(java.lang.String uriObj)
uriObj as object named resource URI value whatever are subject and predicate.
uriObj - The URI of the object resource. The URI of the object resource.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 void setAutoCommitMode(boolean autoCommitMode)
PoKHelperPieceOfKnowledge each time they are called. When performing a lot's
of actions on the RDF, best practice is to set auto commit mode to false and to commit at the end of the process.
setAutoCommitMode in interface PoKHelperautoCommitMode - Whether or not to commit any changes (made by create and remove operations) on 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.public java.lang.String getRdfXml()
String of the current changed made.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 commit()
PoKHelperPoKHelper do not works in "autoCommitMode". Other with this call is not needed.
commit in interface PoKHelperPoKHelper.setAutoCommitMode(boolean)public org.ow2.weblab.core.model.PieceOfKnowledge getPoK()
PoKHelperPieceOfKnowledge which is manipulated. Please not that this will not commit any changes made into the RDF/XML if
PoKHelper do not works in "autoCommitMode" and if you did not call PoKHelper.commit() method.
getPoK in interface PoKHelperPieceOfKnowledge.public void setPoK(org.ow2.weblab.core.model.PieceOfKnowledge pok)
PoKHelperPieceOfKnowledge which is manipulated by the helper. Note that using an PoKHelper without
PieceOfKnowledge will throw RuntimeException.
setPoK in interface PoKHelperpok - An existing PieceOfKnowledgepublic java.util.Set<java.lang.String> getPreds()
Set containing URIs of properties that are predicate of any statement in the PieceOfKnowledge.
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 | |||||||||