예제 #1
0
 /**
  * Transform the KiWiNode node into the datatype T. In case the node cannot be transformed to the
  * respective datatype, throws an IllegalArgumentException that needs to be caught by the class
  * carrying out the transformation.
  *
  * @param rdfBackend
  * @param node
  * @return
  */
 @Override
 public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration)
     throws IllegalArgumentException {
   if (rdfBackend.isLiteral(node)) {
     return rdfBackend.dateTimeValue(node);
   } else {
     throw new IllegalArgumentException("could not parse node, because it is not a literal");
   }
 }
예제 #2
0
 /**
  * Apply the selector to the context node passed as argument and return the collection of selected
  * nodes in appropriate order.
  *
  * @param context the node where to start the selection
  * @param path the path leading to but not including the context node in the current evaluation of
  *     LDPath; may be null, in which case path tracking is disabled
  * @param resultPaths a map where each of the result nodes maps to a path leading to the result
  *     node in the LDPath evaluation; if null, path tracking is disabled and the path argument is
  *     ignored
  * @return the collection of selected nodes
  */
 @Override
 public Collection<Node> select(
     RDFBackend<Node> rdfBackend,
     Node context,
     List<Node> path,
     Map<Node, List<Node>> resultPaths) {
   return Collections.singleton(rdfBackend.createLiteral(constant));
 }