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

Examples of com.hp.hpl.jena.rdf.model.Model.createResource()


        Model model = ParserUtil.getModelProperties();

        Resource eurostatURI = model.createResource(ParserUtil.baseURI);
        Resource eurostatVoIDURI = model.createResource(ParserUtil.baseURI + "void.ttl");
        Resource eurostatDatasetURI = model.createResource(ParserUtil.baseURI + "void.ttl#eurostat");

        model.add(eurostatVoIDURI, ParserUtil.type, model.createResource(ParserUtil.voidURI + "DatasetDescription"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "title"), model.createLiteral("A VoID Description of the eurostat.linked-statistics.org Dataset", "en"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "creator"), model.createResource("http://csarven.ca/#i"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.foaf + "primaryTopic"), eurostatDatasetURI);
View Full Code Here


        Resource eurostatURI = model.createResource(ParserUtil.baseURI);
        Resource eurostatVoIDURI = model.createResource(ParserUtil.baseURI + "void.ttl");
        Resource eurostatDatasetURI = model.createResource(ParserUtil.baseURI + "void.ttl#eurostat");

        model.add(eurostatVoIDURI, ParserUtil.type, model.createResource(ParserUtil.voidURI + "DatasetDescription"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "title"), model.createLiteral("A VoID Description of the eurostat.linked-statistics.org Dataset", "en"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "creator"), model.createResource("http://csarven.ca/#i"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.foaf + "primaryTopic"), eurostatDatasetURI);

        model.add(eurostatDatasetURI, ParserUtil.type, ParserUtil.voidDataset);
View Full Code Here

        Resource eurostatVoIDURI = model.createResource(ParserUtil.baseURI + "void.ttl");
        Resource eurostatDatasetURI = model.createResource(ParserUtil.baseURI + "void.ttl#eurostat");

        model.add(eurostatVoIDURI, ParserUtil.type, model.createResource(ParserUtil.voidURI + "DatasetDescription"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "title"), model.createLiteral("A VoID Description of the eurostat.linked-statistics.org Dataset", "en"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.dcterms + "creator"), model.createResource("http://csarven.ca/#i"));
        model.add(eurostatVoIDURI, model.createProperty(ParserUtil.foaf + "primaryTopic"), eurostatDatasetURI);

        model.add(eurostatDatasetURI, ParserUtil.type, ParserUtil.voidDataset);
        model.add(eurostatDatasetURI, model.createProperty(ParserUtil.foaf + "homepage"), eurostatURI);
        model.add(eurostatDatasetURI, model.createProperty(ParserUtil.dcterms + "title"), model.createLiteral("Eurostat Linked Data", "en"));
View Full Code Here

                if(leaf.getAttribute("type").equals("dataset") || leaf.getAttribute("type").equals("table"))
                {
                    NodeList leafCodes = leaf.getElementsByTagName("nt:code");
                    String code = leafCodes.item(0).getTextContent().trim();

                    Resource dss = model.createResource(ParserUtil.dssURI + code);

                    model.add(eurostatDatasetURI, ParserUtil.voidSubset, dss);
                    model.add(dss, ParserUtil.type, ParserUtil.voidDataset);
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/data/" + code + ".rdf"));
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/dsd/" + code + ".rdf"));
View Full Code Here

  public Model describeResource(String iri) {
    if (!indexIRI.equals(iri)) return wrapped.describeResource(iri);
    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);
    }
View Full Code Here

    allBrowsableNamespaces.addAll(getBrowsableNamespaces());
   
    // 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));
    }
   
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

    StmtIterator it = original.listStatements();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      Resource s = stmt.getSubject();
      if (s.isURIResource()) {
        s = result.createResource(rewrite(s.getURI()));
      }
      Property p = result.createProperty(
          rewrite(stmt.getPredicate().getURI()));
      RDFNode o = stmt.getObject();
      if (o.isURIResource()) {
View Full Code Here

      }
      Property p = result.createProperty(
          rewrite(stmt.getPredicate().getURI()));
      RDFNode o = stmt.getObject();
      if (o.isURIResource()) {
        o = result.createResource(rewrite(o.asResource().getURI()));
      }
      result.add(s, p, o);
    }
    return result;
  }
View Full Code Here

    // add metadata from templates
    Model tplModel = FileManager.get().loadModel(metadataTemplate);

    // iterate over template statements to replace placeholders
    Model metadata = ModelFactory.createDefaultModel();
    currentDocRepr = metadata.createResource();
    StmtIterator it = tplModel.listStatements();
    while (it.hasNext()) {
      Statement stmt = it.nextStatement();
      Resource subj = stmt.getSubject();
      Property pred = stmt.getPredicate();
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.