org.weblab_project.core.helper.impl
Class RDFSelectorFactory

java.lang.Object
  extended by org.weblab_project.core.helper.impl.RDFSelectorFactory

public final class RDFSelectorFactory
extends java.lang.Object


Method Summary
static SimpleSelector getSelector()
          Get a searcher in triples in RDF for literals.
static AdvancedSelector getSelector(boolean supportNullData, java.lang.String... namespaces)
          Create a rdf selector with robustness to bad or null annotations with a list of namespaces.
static SimpleSelector getSelector(java.lang.String... namespaces)
          Create a rdf selector with a list of namespace.
static RDFRulesSelector getSelectorByRules(boolean supportNullData, java.lang.String... namespaces)
          Get a searcher in triples in RDF for literals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSelector

public static SimpleSelector getSelector()
Get a searcher in triples in RDF for literals. If you want to select objects as uri, see getSelector(boolean supportNullData, String... uris).

Returns:
a SimpleSelector searching on literals

getSelector

public static SimpleSelector getSelector(java.lang.String... namespaces)
Create a rdf selector with a list of namespace. If you construct an RDFSelector with the namespace http://www.example.com in parameter, then if you search for "http://www.example.com#Object" as the object of the triple. It will look for object with an URI stating with one of the given namespace instead searching for only literals.

Parameters:
namespaces - a list of namespace
Returns:
a SimpleSelector

getSelector

public static AdvancedSelector getSelector(boolean supportNullData,
                                           java.lang.String... namespaces)
Create a rdf selector with robustness to bad or null annotations with a list of namespaces. Robustness to bad annotation is desactivated by default. If you construct an RDFSelector with the uri http://www.example.com in parameter, then if you search for "http://www.example.com#Object" as the object of the triple. It will look for object with an URI stating with one of the given namespace instead searching for only literals.

Parameters:
supportNullData - if true null data annotation are ignored else an error is thrown.
uris - a list of namespace
Returns:
a AdvancedSelector

getSelectorByRules

public static RDFRulesSelector getSelectorByRules(boolean supportNullData,
                                                  java.lang.String... namespaces)
Get a searcher in triples in RDF for literals.
You can add rules on tuples:

You can also use regular expression in rules. For instance:
RDFRulesSelector rrs = RDFSelectorFactory.getRuleSelector();
rss.addPORule("http://www.weblab-project.org/entity/.*","(.|\\s)*");
List results = rss.findIn(myResource);

If you want to select objects as uri, see getRuleSelector(boolean supportNullData, String... uris).

Parameters:
supportNullData - if true null data annotation are ignored else an error is thrown.
namespaces - a list of namespace
Returns:
a RDFRulesSelector


Copyright © 2004-2010. All Rights Reserved.