org.weblab_project.core.helper.impl
Interface SimpleSelector
- All Known Implementing Classes:
- ComplexTripleSelector
public interface SimpleSelector
Method Summary |
void |
limitToFirstLevelAnnotation(boolean limit)
If limit is true, then all the searches made with this RDFSelector
will stop after the first level of annotation. |
Results |
select(org.weblab_project.core.model.Resource resource,
java.lang.String... predicates)
Build a collection of objects with given properties. |
select
Results select(org.weblab_project.core.model.Resource resource,
java.lang.String... predicates)
- Build a collection of objects with given properties.
Let's say you search for : searchFor(myResource, EVENT, NAME, DATE, LOCATION)
where name is a type of resource and NAME, DATE and LOCATION are predicates.
Then it will return a map :
{
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).
If the resource is null, then a NullPointerException is thrown.
If predicates are null, then all predicates will match the search.
- Parameters:
resource
- an annotated Resourcepredicates
- the list of searched predicates
- Returns:
- an easy and fast access structure collection of triples
limitToFirstLevelAnnotation
void limitToFirstLevelAnnotation(boolean limit)
- If limit is true, then all the searches made with this RDFSelector
will stop after the first level of annotation.
Else the search will recursively browse all the searched Resource structure.
By default limit is false.
- Parameters:
limit
- if true, it will only search annotation on resource else it will search until the leaf annotations
Copyright © 2004-2010. All Rights Reserved.