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

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


      Resource curr = it.nextResource();
        String literal = repair.listObjectsOfProperty( curr, EYE.onLiteral ).nextNode().asNode().getLiteralLexicalForm();

        Resource b = output.createResource( repair.listObjectsOfProperty( curr, EYE.onStatement ).nextNode().asNode().getBlankNodeId() );
        Resource subject = output.createResource( repair.listObjectsOfProperty( b, RDF.subject ).nextNode().asNode().getURI() );
        Property predicate = output.createProperty( repair.listObjectsOfProperty( b, RDF.predicate ).nextNode().asNode().getURI() );
        String oldType = repair.listObjectsOfProperty( curr, EYE.badDatatypeURI ).nextNode().asNode().getLiteralLexicalForm();
        String datatype = repair.listObjectsOfProperty( curr, EYE.newValue ).nextNode().asNode().getLiteralLexicalForm();
       
        output.remove( subject, predicate, output.createTypedLiteral( literal, oldType ) );
        output.add( subject, predicate, output.createTypedLiteral( literal, datatype ) );
        didRepair = true;
      }
   
    it = repair.listSubjectsWithProperty( EYE.repairType, EYE.setLanguage );
    while ( it.hasNext() )
      {
      Resource curr = it.nextResource();
        String literal = repair.listObjectsOfProperty( curr, EYE.onLiteral ).nextNode().asNode().getLiteralLexicalForm();

        Resource b = output.createResource( repair.listObjectsOfProperty( curr, EYE.onStatement ).nextNode().asNode().getBlankNodeId() );
        Resource subject = output.createResource( repair.listObjectsOfProperty( b, RDF.subject ).nextNode().asNode().getURI() );
        Property predicate = output.createProperty( repair.listObjectsOfProperty( b, RDF.predicate ).nextNode().asNode().getURI() );
        String oldType = repair.listObjectsOfProperty( curr, EYE.badDatatypeURI ).nextNode().asNode().getLiteralLexicalForm();
        String lang = repair.listObjectsOfProperty( curr, EYE.newValue ).nextNode().asNode().getLiteralLexicalForm();
       
        output.remove( subject, predicate, output.createTypedLiteral( literal, oldType ) );
        output.add( subject, predicate, output.createLiteral( literal, lang ) );
View Full Code Here


      Resource curr = it.nextResource();
            if ( !curr.hasProperty( EYE.noConsistentTypeFor ) )
                {
                Resource bn = repair.createResource( repair.listObjectsOfProperty( curr, EYE.statementAdded ).nextNode().asNode().getBlankNodeId() );
                Resource subj = output.createResource( repair.listObjectsOfProperty( bn, RDF.subject ).nextNode().asNode().getURI() );
                Property pred = output.createProperty( repair.listObjectsOfProperty( bn, RDF.predicate ).nextNode().asNode().getURI() );
                RDFNode obj = repair.listObjectsOfProperty( bn, RDF.object ).nextNode();
                output.add( subj, pred, obj);
                }
      }
    }
View Full Code Here

          NodeIterator it2 = repair.listObjectsOfProperty( curr, EYE.statementRemoved );
          while ( it2.hasNext() )
            {
            Resource bn = repair.createResource( it2.nextNode().asNode().getBlankNodeId() );
            Resource subj = (Resource)repair.listObjectsOfProperty( bn, RDF.subject ).nextNode();
            Property pred = input.createProperty( repair.listObjectsOfProperty( bn, RDF.predicate ).nextNode().asNode().getURI() );
            RDFNode obj = repair.listObjectsOfProperty( bn, RDF.object ).nextNode();
            output.remove( subj, pred, obj );
            }
          }
        else
View Full Code Here

          NodeIterator it3 = repair.listObjectsOfProperty( subj, EYE.statementRemoved );
          while ( it3.hasNext() )
            {
            Resource remStat = (Resource)it3.nextNode();
            Resource remS = (Resource)repair.listObjectsOfProperty( remStat, RDF.subject ).nextNode();
            Property remP = output.createProperty( repair.listObjectsOfProperty( remStat, RDF.predicate ).nextNode().asNode().getURI() );
            RDFNode remO = repair.listObjectsOfProperty( remStat, RDF.object ).nextNode();
            output.remove( remS, remP, remO );
            }
          }
        else if ( curr.equals( EYE.increaseNumProperties ) )
          {
          Resource addStat = (Resource)repair.listObjectsOfProperty( subj, EYE.statementAdded ).nextNode();
          Resource addS = (Resource)repair.listObjectsOfProperty( addStat, RDF.subject ).nextNode();
          Property addP = output.createProperty( repair.listObjectsOfProperty( addStat, RDF.predicate ).nextNode().asNode().getURI() );
          int target = Integer.parseInt( repair.listObjectsOfProperty( repair.createResource( repair.listObjectsOfProperty( subj, EYE.cardinality ).nextNode().asNode().getBlankNodeId() ), EYE.min ).nextNode().asNode().getLiteralLexicalForm() );
          int start = Integer.parseInt( repair.listObjectsOfProperty( subj, EYE.numValues ).nextNode().asNode().getLiteralLexicalForm() );
          for ( int i = start; i < target; i++ )
            output.add( addS, addP, output.createResource() );
          }
View Full Code Here

      while ( it2.hasNext() )
        {
        Resource bnode = repair.createResource( it2.nextNode().asNode().getBlankNodeId() );
       
        Resource subj =  (Resource)repair.listObjectsOfProperty( bnode, RDF.subject ).nextNode();
        Property pred = output.createProperty( repair.listObjectsOfProperty( bnode, RDF.predicate ).nextNode().asNode().getURI() );
        RDFNode obj = repair.listObjectsOfProperty( bnode, RDF.object ).nextNode();
       
        output.add( subj, pred, obj );
        }
      }
View Full Code Here

    consistent = pelletJenaGraph.isConsistent();
    e = System.currentTimeMillis();
    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
View Full Code Here

    //print time and validation report
    System.out.println( "Total time " + (e - s) + " ms)" );
    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
View Full Code Here

    // load the model to the reasoner
    model.prepare();
   
    // create property and resources to query the reasoner
    OntClass Person = model.getOntClass("http://xmlns.com/foaf/0.1/Person");
    Property workHomepage = model.getProperty("http://xmlns.com/foaf/0.1/workInfoHomepage");
    Property foafName = model.getProperty("http://xmlns.com/foaf/0.1/name");
   
    // get all instances of Person class
    Iterator<?> i = Person.listInstances();
    while( i.hasNext() ) {
        Individual ind = (Individual) i.next();
View Full Code Here

        return null
     }

     public void applyStatement (Statement stmt, ConceptTO conceptTO){
         Resource  subject   = stmt.getSubject();
         Property  predicate = stmt.getPredicate();
         RDFNode   object    = stmt.getObject();
     }
View Full Code Here

    }
    Resource entityRes = entity.getResource();
    if(!entityRes.hasProperty(RDF.type, JenaVocabulary.entity)) {
      entityRes.addProperty(RDF.type, JenaVocabulary.entity);
    }
    Property property = model.createProperty(reputationParser
         .getRiNamespace(), "identifier");
    if(entity.getUniqueIdentificator() != null) {
      Statement statement = entityRes.getProperty(property);
      if(statement == null) {
        entityRes.addProperty(property,
View Full Code Here

TOP

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

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.