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

Examples of com.hp.hpl.jena.rdf.model.Resource.addProperty()


    Resource reification = model.createResource(uri + "_" + property.getLocalName() + "_reification");

    reification.addProperty(rdfSubject, resource);
    reification.addProperty(rdfPredicate, property);
    reification.addProperty(rdfObject, obj.toString());
    reification.addProperty(rdfType, rdfStatement);

    addPotentiallyNullReifiedStatement(reification, edmID, profAttr.getVersion());
    addPotentiallyNullReifiedStatement(reification, edmVersion, profAttr.getVersion());
    addPotentiallyNullReifiedStatement(reification, edmType, profAttr.getType());
View Full Code Here


    Resource reification = model.createResource(uri + "_" + property.getLocalName() + "_reification");

    reification.addProperty(rdfSubject, resource);
    reification.addProperty(rdfPredicate, property);
    reification.addProperty(rdfObject, obj.toString());
    reification.addProperty(rdfType, rdfStatement);

    addPotentiallyNullReifiedStatement(reification, edmID, profAttr.getVersion());
    addPotentiallyNullReifiedStatement(reification, edmVersion, profAttr.getVersion());
    addPotentiallyNullReifiedStatement(reification, edmType, profAttr.getType());
    addPotentiallyNullReifiedStatement(reification, edmStatus, profAttr.getStatusID());
View Full Code Here

    List children = profAttr.getChildren();
    if (!children.isEmpty()) {
      Bag bag = model.createBag(uri + "_" + property.getLocalName() + "_childrenBag");
      for (Iterator i = children.iterator(); i.hasNext();)
        bag.add(i.next());
      reification.addProperty(edmChild, bag);
    }

    List revNotes = profAttr.getRevisionNotes();
    if (!revNotes.isEmpty()) {
      Seq seq = model.createSeq(uri + "_" + property.getLocalName() + "_revNotesSeq");
View Full Code Here

    List revNotes = profAttr.getRevisionNotes();
    if (!revNotes.isEmpty()) {
      Seq seq = model.createSeq(uri + "_" + property.getLocalName() + "_revNotesSeq");
      for (Iterator i = revNotes.iterator(); i.hasNext();)
        seq.add(i.next());
      reification.addProperty(edmRevNote, seq);
    }
  }

  private static void addPotentiallyNullReifiedStatement(Resource reification, Property property, Object value) {
    if (value == null || value.toString().length() == 0) return;
View Full Code Here

        Resource r2 = m.createResource("http://example.org/book#2") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
       
        return m ;
    }
}
View Full Code Here

        Resource r2 = m.createResource("http://example.org/book#2") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
       
        return m ;
    }
}
View Full Code Here

            String key = entry.getKey(), value = entry.getValue();
            if ( !( key.equals( "" ) || value.equals( "" ) ) )
                {
                Resource bn = output.createResource();
                output.add( hook, EYE.usedOntology, bn );
                bn.addProperty( EYE.prefix, key );
                bn.addProperty( EYE.ontURI, output.createResource( value ) );
                }
            }
//        Object[] mapping = entries.toArray();
//        for (int i = 0; i < mapping.length; i += 1)
View Full Code Here

            if ( !( key.equals( "" ) || value.equals( "" ) ) )
                {
                Resource bn = output.createResource();
                output.add( hook, EYE.usedOntology, bn );
                bn.addProperty( EYE.prefix, key );
                bn.addProperty( EYE.ontURI, output.createResource( value ) );
                }
            }
//        Object[] mapping = entries.toArray();
//        for (int i = 0; i < mapping.length; i += 1)
//            {
View Full Code Here

        Resource who = model.createResource(FOAF.Person)
            .addProperty(FOAF.name, "Andy Seaborne")
            .addProperty(FOAF.homepage,
                         model.createResource("http://people.apache.org/~andy")) ;
        Resource reporter = report.getReporter() ;
        reporter.addProperty(DC.creator, who) ;
       
        TestSuite suite = ScriptTestSuiteFactory.make(testManifest) ;
        SimpleTestRunner.runSilent(suite) ;
       
        ScriptTestSuiteFactory.results.getModel().write(System.out, "TTL") ;
View Full Code Here

        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;

        r1.addProperty(RDFS.label, "abc") ;
        r2.addProperty(RDFS.label, "def") ;

        return model  ;
    }
}
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.