Package uk.ac.osswatch.simal.model.jena

Examples of uk.ac.osswatch.simal.model.jena.Document


    com.hp.hpl.jena.rdf.model.Resource r = model.createResource(uri);
    Statement s = model.createStatement(r, RDF.type, FOAF.Document);
    model.add(s);

    IDocument page = new Document(r);
    return page;
  }
View Full Code Here


  public IDocument get(String uri) throws SimalRepositoryException, IncompatibleTypeException {
    IDocument document = null;

    if (getRepository().containsResource(uri)) {
      Resource docResource = getModel().getResource(uri);
      document = new Document(docResource).ensureDocumentType();
    }

    return document;
  }
View Full Code Here

    return document;
  }

  public IDocument getOrCreate(String url) throws SimalRepositoryException, IncompatibleTypeException {
    Document document;
   
    if (getRepository().containsResource(url)) {
      document = (Document) get(url);
    } else {
      Model model = getModel();
      document = new Document(model.createResource(url));
    }

    return document.ensureDocumentType();
  }
View Full Code Here

TOP

Related Classes of uk.ac.osswatch.simal.model.jena.Document

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.