|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.weblab_project.core.helper.impl.TripleSelectors
org.weblab_project.core.helper.impl.ComplexTripleSelector
public class ComplexTripleSelector
Field Summary | |
---|---|
protected java.util.List<Rule> |
rules
|
Fields inherited from class org.weblab_project.core.helper.impl.TripleSelectors |
---|
debug, limit, multi, supportNullData, uris |
Constructor Summary | |
---|---|
ComplexTripleSelector()
|
|
ComplexTripleSelector(boolean supportNullData,
java.lang.String... namespaces)
|
Method Summary | |
---|---|
void |
addPORule(java.lang.String predicat,
java.lang.String object)
Add a filter on an association predicat/object |
void |
addRule(Rule rule)
|
void |
addSORule(java.lang.String subject,
java.lang.String object)
Add a filter on an association subject/object |
void |
addSPRule(java.lang.String subject,
java.lang.String predicat)
Add a filter on an association subject/predicat |
protected java.util.List<WTriple> |
applySelection(org.w3c.dom.Node 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)
Faster |
java.util.List<WTriple> |
findIn(org.weblab_project.core.model.Resource resource)
TODO: A tester |
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. |
protected boolean |
matches(Rule rule,
com.hp.hpl.jena.graph.Triple t)
|
Statements |
searchFor(org.weblab_project.core.model.Resource resource,
java.lang.String... predicates)
Uses rules |
Results |
select(org.weblab_project.core.model.Resource resource,
java.lang.String... predicates)
Build a collection of objects with given properties. |
Methods inherited from class org.weblab_project.core.helper.impl.TripleSelectors |
---|
copyAndAdd, find, findMT, limitToFirstLevelAnnotation, loadModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.weblab_project.core.helper.impl.RDFRulesSelector |
---|
limitToFirstLevelAnnotation |
Methods inherited from interface org.weblab_project.core.helper.impl.AdvancedSelector |
---|
limitToFirstLevelAnnotation |
Methods inherited from interface org.weblab_project.core.helper.impl.SimpleSelector |
---|
limitToFirstLevelAnnotation |
Field Detail |
---|
protected transient java.util.List<Rule> rules
Constructor Detail |
---|
public ComplexTripleSelector()
public ComplexTripleSelector(boolean supportNullData, java.lang.String... namespaces)
Method Detail |
---|
public void addSPRule(java.lang.String subject, java.lang.String predicat)
addSPRule
in interface RDFRulesSelector
subject
- predicat
- public void addSORule(java.lang.String subject, java.lang.String object)
addSORule
in interface RDFRulesSelector
subject
- object
- public void addPORule(java.lang.String predicat, java.lang.String object)
addPORule
in interface RDFRulesSelector
predicat
- object
- public java.util.List<WTriple> findIn(org.weblab_project.core.model.Resource resource)
findIn
in interface RDFRulesSelector
resource
-
protected java.util.List<WTriple> applySelection(org.w3c.dom.Node 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)
applySelection
in class TripleSelectors
public Statements searchFor(org.weblab_project.core.model.Resource resource, java.lang.String... predicates)
searchFor
in interface AdvancedSelector
resource
- an annotated Resourcepredicates
- the list of searched predicates
public java.util.List<WTriple> findInResource(org.weblab_project.core.model.Resource resource, Filter filter)
TripleSelectors
findInResource
in interface AdvancedSelector
findInResource
in class TripleSelectors
resource
- a WebLab Resource on which there are annotations containing RDFfilter
- a set of constrains
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)
TripleSelectors
List<WTriple> results: findInResource(myResource, null, "http://www.weblab-project.org/gld-country", null);
findInResource
in interface AdvancedSelector
findInResource
in class TripleSelectors
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)
TripleSelectors
findInResource
in interface AdvancedSelector
findInResource
in class TripleSelectors
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 void addRule(Rule rule)
protected boolean matches(Rule rule, com.hp.hpl.jena.graph.Triple t)
public Results select(org.weblab_project.core.model.Resource resource, java.lang.String... predicates)
SimpleSelector
{
subject0uri => { NAME => nameObject0, DATE => dateObject0, LOCATION => locationObject0 },
subject1uri => { NAME => nameObject1, DATE => dateObject1, LOCATION => locationObject1 },
subject2uri => { NAME => nameObject2, DATE => dateObject2, LOCATION => locationObject2 }
}
It can access any EVENT in O(1) and any predicate value in O(1).
select
in interface SimpleSelector
resource
- an annotated Resourcepredicates
- the list of searched predicates
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |