Package org.wikier.trioo.jtrioo

Examples of org.wikier.trioo.jtrioo.ResourceManager


   *
   * @param resource resource to introspect
   * @return resource uri
   */
  public static String getURI(Object resource) {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
    return rm.getURI(resource);
  }
View Full Code Here


   * @param resource resource to introspect
   * @param base base uri
   * @return resource uri
   */
  public static String getURI(Object resource, String base) {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
    return rm.getURI(resource, base);
  }
View Full Code Here

   *
   * @param resource resource (object) to be described
   * @return model with the RDF representation of the resource
   */
  public static Model describe(Object resource) {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
    return rm.describe(resource);
  }
View Full Code Here

   *
   * @param resource resource (object) to be described
   * @return model with the RDF representation of the resource
   */
  public static Model describe(Object resource, String uri) {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
    return rm.describe(resource, uri);
  }
View Full Code Here

   * @return  model with the RDF representation of the resources
   */
  @SuppressWarnings("rawtypes")
  public static Model describe(Collection resources) {
    Model model = JenaHelper.createModel();
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
   
    for (Object resource : resources) {
      model.add(rm.describe(resource));
    }
    return model;
  }
View Full Code Here

public final class Demo {
 
  private static final PrintStream out = System.out;
 
  private Demo() {
    ResourceManager rm = ResourceManagerFactory.getResourceManager();
   
    rm.load("http://www.wikier.org/foaf.rdf");
   
    out.println("sergio:");
    out.println("------");
    Person sergio = (Person)rm.find(Person.class, "http://www.wikier.org/foaf#wikier");
    out.println(sergio);
    out.println();
    out.flush();
   
    out.println("diego:");
    out.println("-----");
    Person diego = (Person)rm.find("http://berrueta.net/foaf.rdf#me");
    out.println(diego);
    out.println();
    out.flush();
   
    out.println("all resources:");
    out.println("-------------");
    Object[] persons = rm.findAll(Person.class);
    for (int i=0; i<persons.length; i++) {
      Person person2 = (Person)persons[i];
      out.println(person2);
   
    out.println();
    out.flush();
   
    out.println("serialize:");
    out.println("---------");
    rm.serialize(sergio, new OutputStreamWriter(out));
    out.println();
    out.flush();
  }
View Full Code Here

TOP

Related Classes of org.wikier.trioo.jtrioo.ResourceManager

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.