Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Node


                              dtXSDdayTimeDuration.equals(nv2.getDatatypeURI()) ;
            boolean isYMDur = dtXSDyearMonthDuration.equals(nv1.getDatatypeURI()) &&
                              dtXSDyearMonthDuration.equals(nv2.getDatatypeURI()) ;
            Duration d3 = nv1.getDuration().subtract(nv2.getDuration()) ;
            String lex = d3.toString() ;
            Node n ;
            if ( isDTDur )
                n = NodeFactory.createLiteralNode(lex, null, dtXSDdayTimeDuration) ;
            else if ( isYMDur )
                n = NodeFactory.createLiteralNode(lex, null, dtXSDyearMonthDuration) ;
            else
View Full Code Here


            boolean valid = XSDFuncOp.isDayTime(dur) ;
            if ( ! valid )
                throw new ExprEvalTypeException("Operator '*': only dayTime duration.  Got: "+nv1) ;
            BigDecimal dec = nv2.getDecimal() ;
            Duration r = dur.multiply(dec) ;
            Node n = NodeFactory.createLiteralNode(r.toString(), null, dtXSDdayTimeDuration) ;
            return NodeValue.makeNodeDuration(r, n) ;
        }
        throw new ExprEvalTypeException("Operator '*' : Undefined multiply: "+nv1+" and "+nv2) ;
    }
View Full Code Here

    }

    protected static Iterator<Node> makeSources(DatasetGraph data, Binding b, Node graphVar)
    {
        // TODO This should done as part of substitution.
        Node n2 = resolve(b, graphVar) ;
       
        if ( n2 != null && ! n2.isURI() )
            // Blank node or literal possible after resolving
            return Iter.nullIterator() ;
       
        // n2 is a URI or null.
       
View Full Code Here

       
        protected QueryIterator nextIterator()
        {
            if ( ! graphNames.hasNext() )
                return null ;
            Node gn = graphNames.next() ;

            QueryIterator qIter = buildIterator(parentBinding, gn, opGraph, getExecContext()) ;
            if ( qIter == null )
                // Know to be nothing (e.g. graph does not exist).
                return null ;
View Full Code Here

            {
            protected final QueryNode p = pt.P;
       
            public Iterator<Triple> find( Domain d )
                {
                Node P = p.finder( d );
                if (P.isConcrete())
                    return predicates.iterator( P, Node.ANY, Node.ANY );
                else
                    return subjects.iterateAll();
                }
   
View Full Code Here

        }
    }
   
    public static NodeValue strlen(NodeValue nvString)
    {
        Node n = checkAndGetStringLiteral("strlen", nvString) ;
        int len = n.getLiteralLexicalForm().length() ;
        return NodeValue.makeInteger(len) ;
    }
View Full Code Here

        return substring(v1, v2, null) ;
    }

    public static NodeValue substring(NodeValue nvString, NodeValue nvStart, NodeValue nvLength)
    {
        Node n = checkAndGetStringLiteral("substring", nvString) ;
        RDFDatatype dt = n.getLiteralDatatype() ;
        String lang = n.getLiteralLanguage() ;
       
        // A string of some kind.
       
        // XSD F&O:
        try {
            // NaN, float and double.
           
            String string = n.getLiteralLexicalForm() ;
            int start = intValueStr(nvStart, string.length()+1) ;
            int length ;
           
            if ( nvLength != null )
                length = intValueStr(nvLength, 0) ;
View Full Code Here

        return NodeValue.booleanReturn(lex1.endsWith(lex2)) ;
    }
   
    private static NodeValue calcReturn(String result, Node arg)
    {
        Node n2 = Node.createLiteral(result, arg.getLiteralLanguage(), arg.getLiteralDatatype()) ;
        return NodeValue.makeNode(n2) ;
       
//        if ( arg.getLiteralDatatype() != null )
//        {
//            if ( arg.getLiteralDatatype() != XSDDatatype.XSDstring )
View Full Code Here

    public static NodeValue strBefore(NodeValue string, NodeValue match)
    {
        checkTwoArgumentStringLiterals("strBefore", string, match) ;
        String lex1 = string.asNode().getLiteralLexicalForm() ;
        String lex2 = match.asNode().getLiteralLexicalForm() ;
        Node mainArg = string.asNode() ;
       
        if ( lex2.length() == 0 )
            return calcReturn("", mainArg) ;
       
        int i = lex1.indexOf(lex2) ;
View Full Code Here

    public static NodeValue strAfter(NodeValue string, NodeValue match)
    {
        checkTwoArgumentStringLiterals("strAfter", string, match) ;
        String lex1 = string.asNode().getLiteralLexicalForm() ;
        String lex2 = match.asNode().getLiteralLexicalForm() ;
        Node mainArg = string.asNode() ;
       
        if ( lex2.length() == 0 )
            return calcReturn(lex1, mainArg) ;
       
        int i = lex1.indexOf(lex2) ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.