Examples of AnonId


Examples of com.hp.hpl.jena.rdf.model.AnonId

                    Node n ;
                    // One case; VARS line then *
                    if ( token.hasType(TokenType.STAR ) || ( token.isCtlCode() && token.getCntrlCode() == -1 ) )
                        n = lastLine.get(v) ;
                    else if ( token.hasType(TokenType.BNODE) )
                        n = NodeFactory.createAnon(new AnonId(NodeFmtLib.decodeBNodeLabel(token.getImage()))) ;
                    else
                        n = profile.create(null, token) ;
                    binding.add(v, n) ;
                }
                i++ ;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

        try {
           
            MessageDigest digester = MessageDigest.getInstance("MD5");
            digester.reset();
            byte[] digest = digester.digest(key.toString().getBytes());
            Node skolem = NodeFactory.createAnon( new AnonId( Base64.encode(digest) ) );
            return context.getEnv().bind(args[0], skolem);
           
        } catch (NoSuchAlgorithmException e) {
            throw new JenaException(e);
        }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

//                return Node_RuleVariable.WILD;
            } else if (token.startsWith("<") && token.endsWith(">")) {
                String uri = token.substring(1, token.length()-1);
                return NodeFactory.createURI(uri);
            } else if (token.startsWith( "_" )) { // TODO rationalise [this is for the RIF code]
                return NodeFactory.createAnon( new AnonId( token.substring( 1 ) ) );
            } else if (token.indexOf(':') != -1) {
                String exp = prefixMapping.expandPrefix(token); // Local map first
                exp = PrintUtil.expandQname(exp)// Retain global map for backward compatibility
                if (exp == token) {
                    // No expansion was possible
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    {
        if ( s.startsWith("Double"))
            System.err.println(s) ;
       
        if ( s.startsWith("_:") )
            return NodeFactory.createAnon(new AnonId(s.substring(2))) ;
        return stringToNode(s, prefixMapping) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    private static Node makeNode(String lex, String datatype, String lang, ValueType vType)
    {
        switch (vType)
        {
            case BNODE:
                return NodeFactory.createAnon(new AnonId(lex)) ;
            case URI:
                return NodeFactory.createURI(lex) ;
            case STRING:
                return NodeFactory.createLiteral(lex, lang, false) ;
            case XSDSTRING:
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    public static Node decode(String s, PrefixMapping pmap)
    {
        if ( s.startsWith("_:") )  
        {
            s = s.substring(2) ;
            return NodeFactory.createAnon(new AnonId(s)) ;
        }

        if ( s.startsWith("<") )
        {
            s = s.substring(1,s.length()-1) ;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

        {
            // Must be done this way.
            // In particular, bnode labels can contain ":" from Jena
            // TokenizerText does not recognize these.
            str = str.substring(2) ;
            return NodeFactory.createAnon(new AnonId(str)) ;
        }

        if ( str.startsWith("<") )
        {
            // Do directly.
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    {
        // Is it a bNode label? i.e. <_:xyz>
        if ( isBNodeIRI(iri) )
        {
            String s = iri.substring(bNodeLabelStart.length()) ;
            Node n = NodeFactory.createAnon(new AnonId(s)) ;
            return n ;
        }
        return NodeFactory.createURI(iri) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    public Node asNode(PrefixMap pmap)
    {
        switch(tokenType)
        {
            // Assumes that bnode labels have been sorted out already.
            case BNODE : return NodeFactory.createAnon(new AnonId(tokenImage)) ;
            case IRI :   return NodeFactory.createURI(tokenImage) ;
            case PREFIXED_NAME :
                if ( pmap == null )
                    return NodeFactory.createURI("urn:prefixed-name:"+tokenImage+":"+tokenImage2) ;
                String x = pmap.expand(tokenImage, tokenImage2) ;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    private Node alloc(byte[] labelBytes) {
        mDigest.update(seedBytes) ;
        mDigest.update(labelBytes) ;
        byte[] bytes = mDigest.digest() ; // resets
        String hexString = Bytes.asHexLC(bytes) ;
        return NodeFactory.createAnon(new AnonId(hexString)) ;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.