Class FUN_CSSPath

java.lang.Object
org.apache.jena.sparql.function.FunctionBase
org.apache.jena.sparql.function.FunctionBase2
fr.mines_stetienne.ci.sparql_generate.xml.FUN_CSSPath
All Implemented Interfaces:
org.apache.jena.sparql.function.Function

public class FUN_CSSPath extends org.apache.jena.sparql.function.FunctionBase2
Binding function fun:CSSPath evaluates a CSS Selector over a HTML document and can return (a) the outer HTML, (b) the inner text, or (c) the value of an attribute. The parameters are defined as follows
  • Param 1: (html) is a literal that contains a HTML document;
  • Param 2: (cssSelector) is the CSS Selector. See https://jsoup.org/apidocs/org/jsoup/select/Selector.html for the base syntax specification. By default, the output is the outer HTML of the first matched element. However, two additions to the CSS Selector syntax can change this behaviour:
    • (if the selector ends with /text()) the output is the combined text of the first matched element and all its children. Whitespace is normalized and trimmed.
    • (if the selector ends with @attributeName) the output is the value of the attribute attributeName for the first matched element.
The output is a string literal.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.jena.sparql.expr.NodeValue
    exec​(org.apache.jena.sparql.expr.NodeValue html, org.apache.jena.sparql.expr.NodeValue query)
     
    org.apache.jena.sparql.expr.NodeValue
    select​(org.jsoup.nodes.Element htmldoc, String selectPath)
     

    Methods inherited from class org.apache.jena.sparql.function.FunctionBase2

    checkBuild, exec

    Methods inherited from class org.apache.jena.sparql.function.FunctionBase

    build, evalArgs, exec

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.function.Function

    build
  • Field Details

  • Constructor Details

    • FUN_CSSPath

      public FUN_CSSPath()
  • Method Details

    • exec

      public org.apache.jena.sparql.expr.NodeValue exec(org.apache.jena.sparql.expr.NodeValue html, org.apache.jena.sparql.expr.NodeValue query)
      Specified by:
      exec in class org.apache.jena.sparql.function.FunctionBase2
    • select

      public org.apache.jena.sparql.expr.NodeValue select(org.jsoup.nodes.Element htmldoc, String selectPath) throws org.apache.jena.sparql.expr.ExprEvalException
      Throws:
      org.apache.jena.sparql.expr.ExprEvalException