Package com.hp.hpl.jena.rdf.model

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


        { r.declareProperty( EYE.hasNoType ); }
   
    public void inspectStatement( Report r, Statement s )
        {
        inspectResource( r, s, s.getSubject() );
        RDFNode ob = s.getObject();
        if (checkLiteralTypes && ob.isLiteral()) inspectLiteral( r, s, (Literal) ob );
        if (checkObjectTypes && ob.isResource()) inspectResource( r, s, (Resource) ob );                    
        }
View Full Code Here


        if (it2.hasNext())
          {
          boolean oneKept = false;
          while ( it2.hasNext() )
            {
            RDFNode curra = it2.nextNode();
            if ( m.getNsPrefixURI( curra.asNode().getLiteralLexicalForm() ) != null )
              if ( m.getNsPrefixURI( curra.asNode().getLiteralLexicalForm() ).equals( uri ) )   // The prefix is still used in the model
                {
                if ( oneKept )
                  m.removeNsPrefix( curra.asNode().getLiteralLexicalForm() );
                else
                  oneKept = true;
                }
            }
          }
View Full Code Here

      ResIterator it1 = repair.listSubjectsWithProperty( EYE.badURI );
      while( it1.hasNext() )
        {
        Resource curr = it1.nextResource();
        NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.forReason );
        RDFNode uri = repair.listObjectsOfProperty( curr, EYE.badURI ).nextNode();
        String work = uri.asNode().getLiteralLexicalForm();
        while ( it2.hasNext() )
          {
          String fault = it2.nextNode().asNode().getURI();
          repair.add( curr, EYE.checkFix, RDF.subject );
          repair.remove( repair.listStatements( curr, EYE.newValue, work ) );
View Full Code Here

        // -------- Named graphs
        List<RDFNode> nodes = GraphUtils.multiValue(root, DatasetAssemblerVocab.pNamedGraph) ;

        for (Iterator<RDFNode> iter = nodes.iterator(); iter.hasNext();) {
            RDFNode n = iter.next() ;
            if ( !(n instanceof Resource) )
                throw new DatasetAssemblerException(root, "Not a resource: " + FmtUtils.stringForRDFNode(n)) ;
            Resource r = (Resource)n ;

            String gName = GraphUtils.getAsStringValue(r, DatasetAssemblerVocab.pGraphName) ;
View Full Code Here

            if ( !rs.hasNext() )
                throw new ARQException("Not found: var ?" + varname) ;

            QuerySolution qs = rs.nextSolution() ;
            RDFNode r = qs.get(varname) ;
            if ( rs.hasNext() )
                throw new ARQException("More than one: var ?" + varname) ;
            return r ;
        }
        finally {
View Full Code Here

            if ( !rs.hasNext() )
                return null ;

            QuerySolution qs = rs.nextSolution() ;
            RDFNode r = qs.get(varname) ;
            if ( rs.hasNext() ) {
                QuerySolution qs2 = rs.next() ;
                RDFNode r2 = qs2.get(varname) ;
                if ( rs.hasNext() )
                    throw new ARQException("More than one: var ?" + varname + " -> " + r + ", " + r2 + ", ...") ;
                else
                    throw new ARQException("Found two matches: var ?" + varname + " -> " + r + ", " + r2) ;
            }
View Full Code Here

            // Force nodes to be materialized.
            QuerySolution result = resultSet.nextSolution() ;
            for ( Iterator<String> iter = result.varNames() ; iter.hasNext() ; )
            {
                String vn = iter.next();
                RDFNode n = result.get(vn) ;
            }
            count++ ;
        }
        return count ;
    }
View Full Code Here

            return ;

        for ( Iterator<String> iter = qSolution.varNames() ; iter.hasNext() ; ) {
            String n = iter.next() ;

            RDFNode x = qSolution.get(n) ;
            if ( Var.isBlankNodeVarName(n) )
                continue ;
            try {
                binding.add(Var.alloc(n), x.asNode()) ;
            }
            catch (ARQInternalErrorException ex) {
                // bad binding attempt.
                Log.warn(BindingUtils.class, "Attempt to bind " + n + " when already bound") ;
            }
View Full Code Here

    System.out.println( "Consistent? " + consistent + " (" + (e - s) + "ms)" );

    // perform ABox addition which results in an inconsistent KB
    Property role = model.getProperty( foaf + "mbox" );
    individual = model.getIndividual( mindswappers + "Christian.Halaschek" );
    RDFNode mbox = model.getIndividual( "mailto:kolovski@cs.umd.edu" );
    individual.addProperty( role, mbox );

    // perform incremental consistency check
    s = System.currentTimeMillis();
    consistent = pelletJenaGraph.isConsistent();
View Full Code Here

    JenaReasoner.printIterator( model.validate().getReports(), "Validation Results" );

    // perform ABox addition which results in an inconsistent KB
    Property role = model.getProperty( foaf + "mbox" );
    individual = model.getIndividual( mindswappers + "Christian.Halaschek" );
    RDFNode mbox = model.getIndividual( "mailto:kolovski@cs.umd.edu" );
    individual.addProperty( role, mbox );

    // perform incremental consistency check
    s = System.currentTimeMillis();
    model.prepare();
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.RDFNode

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.