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

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


      String id = ((complexType) t).getID(elem,ctx);
      Resource o = id==null?m.createResource():m.createResource(addFragment(ctx.getBaseMap(), id).toString());
      stmt = m.createStatement(subject,prop,o);
      // the new resource, o, becomes the subject
      if (is_nillable() && elem.hasAttributeNS(schema.XSI,"nil") && elem.getAttributeNS(schema.XSI,"nil").equals("true"))
        o.addProperty(RDF.value,RDF.nil);

      Seq subSeq = null;
      if (ctx.isSequenced() && elem.hasChildNodes() && ((complexType) t).needSeq(new HashSet<String>(),ctx))
        subSeq = m.getSeq(o.addProperty(RDF.type, RDF.Seq));
     
View Full Code Here


      if (is_nillable() && elem.hasAttributeNS(schema.XSI,"nil") && elem.getAttributeNS(schema.XSI,"nil").equals("true"))
        o.addProperty(RDF.value,RDF.nil);

      Seq subSeq = null;
      if (ctx.isSequenced() && elem.hasChildNodes() && ((complexType) t).needSeq(new HashSet<String>(),ctx))
        subSeq = m.getSeq(o.addProperty(RDF.type, RDF.Seq));
     
      int index = ((complexType) t).toRDF(o, elem, 0, subSeq, null,true,ctx);
      // mop up remaining values in sequence
      produceMixed(subSeq, index, elem);
    }
View Full Code Here

          stmt = m.createStatement(subject,prop,o);
          // the new resource, o, becomes the subject
                   
          Seq subSeq = null;
          if (ctx.isSequenced() && elem.hasChildNodes() && c.needSeq(new HashSet<String>(), ctx))
            subSeq = m.getSeq(o.addProperty(RDF.type, RDF.Seq));
   
          int index = c.toRDF(o, elem, 0, subSeq,null,true,ctx);
          // mop up remaining values in sequence
          produceMixed(subSeq, index, elem);
View Full Code Here

        Statement s = si.nextStatement();
        if (s.getObject().equals(rez)) continue;
        if (s.getObject().equals(RDFS.Resource)) continue;
        if (s.getObject().equals(RDFS.Class)) continue;
        else if (s.getObject().isLiteral())
          r.addProperty(s.getPredicate(),s.getLiteral());
        else
          r.addProperty(s.getPredicate(), copyResource(s.getResource()));
      }
      return r;
    }
View Full Code Here

        if (s.getObject().equals(RDFS.Resource)) continue;
        if (s.getObject().equals(RDFS.Class)) continue;
        else if (s.getObject().isLiteral())
          r.addProperty(s.getPredicate(),s.getLiteral());
        else
          r.addProperty(s.getPredicate(), copyResource(s.getResource()));
      }
      return r;
    }
    else return rez;
  }
View Full Code Here

    Model result = ModelFactory.createDefaultModel();
    result.setNsPrefix("sioc", SIOC_NS);
    result.setNsPrefix("rdfs", RDFS.getURI());
    Resource index = result.createResource(indexIRI);
    // TODO: Get label from the vocabulary store, and make it i18nable
    index.addProperty(RDFS.label, "Index of Resources", "en");
    for (Resource r: wrapped.getIndex()) {
      index.addProperty(siocContainerOf, r);
    }
    return result;
  }
View Full Code Here

   
    // Create datasets from conf:loadVocabularyFromURL
    for (String sourceURL: getIRIs(CONF.loadVocabulary)) {
      Model m = ModelFactory.createDefaultModel();
      Resource dummyDataset = m.createResource();
      dummyDataset.addProperty(CONF.loadRDF, m.createResource(sourceURL));
      dummyDataset.addProperty(RDF.type, CONF.AnnotationProvider);
      datasets.add(new Dataset(dummyDataset, this));
    }
   
    labelProperties = getProperties(CONF.labelProperty);
View Full Code Here

    result.setNsPrefix("rdfs", RDFS.getURI());
    Resource index = result.createResource(indexIRI);
    // TODO: Get label from the vocabulary store, and make it i18nable
    index.addProperty(RDFS.label, "Index of Resources", "en");
    for (Resource r: wrapped.getIndex()) {
      index.addProperty(siocContainerOf, r);
    }
    return result;
  }
  private final static String SIOC_NS = "http://rdfs.org/sioc/ns#";
  private final static Property siocContainerOf =
View Full Code Here

    // Create datasets from conf:loadVocabularyFromURL
    for (String sourceURL: getIRIs(CONF.loadVocabulary)) {
      Model m = ModelFactory.createDefaultModel();
      Resource dummyDataset = m.createResource();
      dummyDataset.addProperty(CONF.loadRDF, m.createResource(sourceURL));
      dummyDataset.addProperty(RDF.type, CONF.AnnotationProvider);
      datasets.add(new Dataset(dummyDataset, this));
    }
   
    labelProperties = getProperties(CONF.labelProperty);
    if (labelProperties.isEmpty()) {
View Full Code Here

    ModelUtil.addNSIfUndefined(model, "rdfs", RDFS.getURI());

    // Add document metadata
    Resource topic = model.getResource(controller.getAbsoluteIRI());
    Resource document = model.getResource(documentURL);
    document.addProperty(FOAF.primaryTopic, topic);
    document.addProperty(RDFS.label, title);
   
    // Add custom metadata
    for (Dataset dataset: config.getDatasets()) {
      MetadataConfiguration metadata = dataset.getMetadataConfiguration();
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.