|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weblab_project.utils.BackEndJenaHelper
org.weblab_project.core.helper.impl.TripleSelectors
public class TripleSelectors
Selectors Helper to ease annotations retrieval.
Annotations triples are referenced by WTriple in which
subject and object can be references to WebLab Resources.
By default, it transforms reified triples as normal triples.
It is useful if you just bother on data selection.
Example:
List<WTriple> results = findInResource(myResource, null, "http://www.weblab-project.org/gld-country", null);
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.weblab_project.utils.BackEndJenaHelper |
---|
org.weblab_project.utils.BackEndJenaHelper.RDFNodeTypes, org.weblab_project.utils.BackEndJenaHelper.ResourceTypes |
Field Summary | |
---|---|
static boolean |
debug
|
boolean |
limit
|
boolean |
supportNullData
|
java.lang.String[] |
uris
|
Constructor Summary | |
---|---|
TripleSelectors()
|
|
TripleSelectors(boolean supportNullData,
java.lang.String... uris)
|
Method Summary | |
---|---|
protected java.util.List<WTriple> |
applySelection(java.lang.String data,
com.hp.hpl.jena.graph.Node s,
com.hp.hpl.jena.graph.Node p,
com.hp.hpl.jena.graph.Node o,
java.lang.String text,
org.weblab_project.core.model.Resource annotated,
java.util.List<org.weblab_project.core.model.Resource> resources,
org.weblab_project.core.model.PieceOfKnowledge annotation)
|
protected java.util.List<org.weblab_project.core.model.Resource> |
copyAndAdd(java.util.List<org.weblab_project.core.model.Resource> resources,
org.weblab_project.core.model.Resource r)
Copies a list of resources and add an object |
protected java.util.List<WTriple> |
find(org.weblab_project.core.model.PieceOfKnowledge annotation,
java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
java.lang.String text,
org.weblab_project.core.model.Resource annotated,
java.util.List<org.weblab_project.core.model.Resource> resources)
Select RDF Triplet in an annotation |
java.util.List<WTriple> |
findInResource(org.weblab_project.core.model.Resource resource,
Filter filter)
Select WTriple in the resource according to constrains in a filter. |
java.util.List<WTriple> |
findInResource(org.weblab_project.core.model.Resource resource,
java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Select Triplet (Subject, Predicate, Object) in the resource and its sub elements (Segments, Annotations, sub-MediaUnit ...). |
java.util.List<WTriple> |
findInResource(org.weblab_project.core.model.Resource resource,
java.lang.String subject,
java.lang.String predicate,
java.lang.String object,
boolean reif)
Select WTriple in resource according to given subject, predicate and object. |
void |
limitToFirstLevelAnnotation(boolean limit)
|
Methods inherited from class org.weblab_project.utils.BackEndJenaHelper |
---|
addToModel, addToModel, close, containsResource, containsStatement, convertReifMap, createAnonResStat, createAnonResStatOnAnonSubj, createAnonResStatReif, createAnonResStatReif, createAnonResStatReifOnAnonSubj, createAnonResStatReifOnAnonSubj, createLitStat, createLitStat, createLitStatOnAnonSubj, createLitStatReif, createLitStatReif, createLitStatReifOnAnonSubj, createLitStatReifOnAnonSubj, createReifiedStatement, createResStat, createResStatOnAnonSubj, createResStatReif, createResStatReif, createResStatReifOnAnonSubj, createResStatReifOnAnonSubj, createStatement, createStatement, createTempLit, createTempLit, createTempProp, createTempRes, finalize, getAnonReifStats, getAnonResOfAnonReifStat, getAnonResOnPredAnonResStatReif, getAnonResOnPredAnonResStatReifOnAnonSubj, getAnonResOnPredAnonStatReif, getAnonResOnPredAnonSubj, getAnonResOnPredLitStatReif, getAnonResOnPredLitStatReifOnAnonSubj, getAnonResOnPredResStatReif, getAnonResOnPredResStatReifOnAnonSubj, getAnonResOnPredStatReif, getAnonResOnPredSubj, getAnonResOnReifStat, getAnonSubj, getAnonSubjOfAnonReifStat, getAnonSubjOfReifStat, getAnonSubjOnPred, getAnonSubjOnPredAnonRes, getAnonSubjOnPredLit, getAnonSubjOnPredRes, getLitOfAnonReifStat, getLitOfReifStat, getLitOnPredAnonResStatReif, getLitOnPredAnonResStatReifOnAnonSubj, getLitOnPredAnonStatReif, getLitOnPredAnonSubj, getLitOnPredLitStatReif, getLitOnPredLitStatReifOnAnonSubj, getLitOnPredResStatReif, getLitsOnPredResStatReifOnAnonSubj, getLitsOnPredStatReif, getLitsOnPredSubj, getLitsOnPredSubj, getModel, getNSPrefixes, getObjects, getObjects, getPredicates, getPredOfAnonReifStat, getPredOfReifStat, getPredOnAnonResStatReif, getPredOnAnonResStatReifOnAnonSubj, getPredOnAnonStatReif, getPredOnAnonSubj, getPredOnLitStatReif, getPredOnLitStatReifOnAnonSubj, getPredOnResStatReif, getPredOnResStatReifOnAnonSubj, getPredOnStatReif, getPreds, getPredsOnSubj, getRdfXml, getReifiedStatementObject, getReifiedStatementPredicate, getReifiedStatementSubject, getReifStats, getReifStats, getResOfAnonReifStat, getResOfReifStat, getResOnPredAnonResStatReif, getResOnPredAnonResStatReifOnAnonSubj, getResOnPredAnonStatReif, getResOnPredAnonSubj, getResOnPredLitStatReif, getResOnPredLitStatReifOnAnonSubj, getResOnPredResStatReif, getResOnPredResStatReifOnAnonSubj, getResOnPredStatReif, getRessOnPredSubj, getSpecifiedReifStat, getSubjects, getSubjects, getSubjOfAnonReifStat, getSubjOfReifStat, getSubjOnPredAnonRes, getSubjs, getSubjsOnPred, getSubjsOnPredLit, getSubjsOnPredRes, hasAnonResStat, hasAnonResStatOnAnonSubj, hasLitStat, hasLitStatOnAnonSubj, hasResStat, hasResStatOnAnonSubj, isAnonResStatReif, isAnonResStatReifOnAnonSubj, isDefinedAnonRes, isDefinedResource, isLitStatReif, isLitStatReifOnAnonSubj, isReified, isResStatReif, isResStatReifOnAnonSubj, listReifiedStatements, listStatements, modelFromFile, removeAnonReifStat, removeAnonResStat, removeAnonResStatOnAnonSubj, removeLitStat, removeLitStatOnAnonSubj, removeReification, removeReifStat, removeResStat, removeResStatOnAnonSubj, removeStatement, removeStatsOnAnonSubj, removeStatsOnSubj, removeStatsWithLit, removeStatsWithPred, removeStatsWithRes, removeStatWithAnonRes, setNSPrefix |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean limit
public static boolean debug
public boolean supportNullData
public transient java.lang.String[] uris
Constructor Detail |
---|
public TripleSelectors()
public TripleSelectors(boolean supportNullData, java.lang.String... uris)
Method Detail |
---|
public void limitToFirstLevelAnnotation(boolean limit)
public java.util.List<WTriple> findInResource(org.weblab_project.core.model.Resource resource, java.lang.String subject, java.lang.String predicate, java.lang.String object)
List<WTriple> results: findInResource(myResource, null, "http://www.weblab-project.org/gld-country", null);
subject
- the subject that should match in the triplet (can be null)predicate
- the predicate that should match in the triplet (can be null)object
- the object that should match in the triplet (can be null)
public java.util.List<WTriple> findInResource(org.weblab_project.core.model.Resource resource, java.lang.String subject, java.lang.String predicate, java.lang.String object, boolean reif)
resource
- a WebLab Resource on which there are annotations containing RDFsubject
- the subject that should match in the triplet (can be null)predicate
- the predicate that should match in the triplet (can be null)object
- the object that should match in the triplet (can be null)reif
- if true, reified triple will not be aggregated
public java.util.List<WTriple> findInResource(org.weblab_project.core.model.Resource resource, Filter filter)
resource
- a WebLab Resource on which there are annotations containing RDFfilter
- a set of constrainsprotected java.util.List<org.weblab_project.core.model.Resource> copyAndAdd(java.util.List<org.weblab_project.core.model.Resource> resources, org.weblab_project.core.model.Resource r)
resources
- list of resourcesr
- a resource
protected java.util.List<WTriple> find(org.weblab_project.core.model.PieceOfKnowledge annotation, java.lang.String subject, java.lang.String predicate, java.lang.String object, java.lang.String text, org.weblab_project.core.model.Resource annotated, java.util.List<org.weblab_project.core.model.Resource> resources)
annotation
- an annotationsubject
- the subject that should match in the triplet (can be null)predicate
- the predicate that should match in the triplet (can be null)object
- the object that should match in the triplet (can be null)text
- the text associated with the annotation if anyresources
- the parent resources
protected java.util.List<WTriple> applySelection(java.lang.String data, com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o, java.lang.String text, org.weblab_project.core.model.Resource annotated, java.util.List<org.weblab_project.core.model.Resource> resources, org.weblab_project.core.model.PieceOfKnowledge annotation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |