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

Examples of com.hp.hpl.jena.rdf.model.ResIterator.toList()


      Model model = WorksheetR2RMLJenaModelParser.loadSourceModelIntoJenaModel(modelURL);
      Property rdfTypeProp = model.getProperty(Uris.RDF_TYPE_URI);
      Property baseURIProp = model.getProperty(Uris.KM_HAS_BASEURI);
      RDFNode node = model.getResource(Uris.KM_R2RML_MAPPING_URI);
      ResIterator res = model.listResourcesWithProperty(rdfTypeProp, node);
      List<Resource> resList = res.toList();
      for(Resource r: resList)
      {
        if (r.hasProperty(baseURIProp)) {
          baseURI = r.getProperty(baseURIProp).asTriple().getObject().toString();
          baseURI = baseURI.replace("\"", "");
View Full Code Here


    }
  private Resource getMappingResourceFromSourceName() throws KarmaException {
    Property sourceNameProp = model.getProperty(Uris.KM_SOURCE_NAME_URI);
    RDFNode node = model.createLiteral(id.getName());
    ResIterator res = model.listResourcesWithProperty(sourceNameProp, node);
    List<Resource> resList = res.toList();
   
    if (resList.size() > 1) {
      throw new KarmaException("More than one resource exists with source name: " + id.getName());
    } else if (resList.size() == 1) {
      return resList.get(0);
View Full Code Here

      } else if(sourceObjects.size() == 1) {
        RDFNode prevSourceObject = sourceObjects.get(0);
       
        //We got the previous source object, now get the Subject Node for this
        ResIterator prevSourceSubjectsIter = model.listResourcesWithProperty(sourceNameProp, prevSourceObject);
        List<Resource> prevSourceSubjects = prevSourceSubjectsIter.toList();
       
        if (prevSourceSubjects.size() == 1) {
          Resource subject = prevSourceSubjects.get(0);
          model.remove(subject, sourceNameProp, prevSourceObject);
          model.add(subject, sourceNameProp, node);
View Full Code Here

      Model model = WorksheetR2RMLJenaModelParser.loadSourceModelIntoJenaModel(url);
      Property rdfTypeProp = model.getProperty(Uris.RDF_TYPE_URI);

      RDFNode node = model.getResource(Uris.KM_R2RML_MAPPING_URI);
      ResIterator res = model.listResourcesWithProperty(rdfTypeProp, node);
      List<Resource> resList = res.toList();
      for(Resource r: resList)
      {
        model.add(r, model.getProperty(Uris.OWL_SAMEAS_URI), model.getResource(url.toString()));
      }
      model.write(test,"TTL");
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.