@ApplicationScoped public class LDPathServiceImpl extends Object implements LDPathService
| Constructor and Description |
|---|
LDPathServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Set<SelectorFunction<org.openrdf.model.Value>> |
getFunctions()
List all selector functions that are currently registered with LDPath.
|
Set<String> |
getTransformableTypes()
List all types that have a transformer registered.
|
void |
initialise() |
Collection<org.openrdf.model.Value> |
pathQuery(org.openrdf.model.Value context,
String path,
Map<String,String> namespaces)
Run a path query starting from the given context node and return the result as a collection of KiWiNodes.
|
Map<org.openrdf.model.Value,Map<String,Collection<?>>> |
programQuery(String program)
Run a path program over all resources in the triplestore matching the program's filter and return the result for
each respurce.
|
Map<String,Collection<?>> |
programQuery(org.openrdf.model.Value context,
String program)
Run a path program starting from the given context node and return the result as a collection of KiWiNodes for
each field occurring in the path progrm.
|
void |
registerFunction(SelectorFunction<org.openrdf.model.Value> function)
Register an LDPath function in this LDPath service.
|
void |
registerTransformer(String typeUri,
NodeTransformer<?,org.openrdf.model.Value> transformer)
Register a result transformer for a type URI.
|
@PostConstruct public void initialise()
public void registerFunction(SelectorFunction<org.openrdf.model.Value> function)
registerFunction in interface LDPathServicefunction - public void registerTransformer(String typeUri, NodeTransformer<?,org.openrdf.model.Value> transformer)
LDPathServiceregisterTransformer in interface LDPathServicetypeUri - a URI identifying the type for which to use this transformer; can be specified
in path programstransformer - instance of a node transformerpublic Set<SelectorFunction<org.openrdf.model.Value>> getFunctions()
getFunctions in interface LDPathServicepublic Set<String> getTransformableTypes()
LDPathServicegetTransformableTypes in interface LDPathServicepublic Collection<org.openrdf.model.Value> pathQuery(org.openrdf.model.Value context, String path, Map<String,String> namespaces) throws LDPathParseException
pathQuery in interface LDPathServicecontext - the context node where to start with the path querypath - the path query to evaluate starting from the context nodenamespaces - optional map from namespace prefixes to namespace URIsLDPathParseException - when the path passed as argument could not be parsedpublic Map<String,Collection<?>> programQuery(org.openrdf.model.Value context, String program) throws LDPathParseException
programQuery in interface LDPathServicecontext - the context node where to start with the path queryprogram - the path program to evaluate starting from the context nodeLDPathParseException - when the path passed as argument could not be parsedpublic Map<org.openrdf.model.Value,Map<String,Collection<?>>> programQuery(String program) throws LDPathParseException
programQuery in interface LDPathServiceprogram - LDPathParseExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.