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

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


          com.hp.hpl.jena.rdf.model.Resource res = model.createResource(uri);
          s = model.createStatement(r, RDFS.seeAlso, res);
          model.add(s);
        }

        IPerson person = new Person(r);
        person.setSimalID(personID);
        return person;
  }
View Full Code Here


      Set<IPerson> people = new HashSet<IPerson>();
      while (results.hasNext()) {
        QuerySolution soln = results.nextSolution();
        RDFNode node = soln.get("person");
        if (node.isResource()) {
          people.add(new Person((com.hp.hpl.jena.rdf.model.Resource) node));
        }
      }
      qe.close();
      return people;
    }
View Full Code Here

      IPerson person = null;
      while (results.hasNext()) {
        QuerySolution soln = results.nextSolution();
        RDFNode node = soln.get("person");
        if (node.isResource()) {
          person = new Person((com.hp.hpl.jena.rdf.model.Resource) node);
        }
      }
      qe.close();
      return person;
    }
View Full Code Here

  public IPerson get(String uri) throws SimalRepositoryException {
    Model model = ((JenaSimalRepository)getRepository()).getModel();
    if(uri.startsWith(RDFUtils.PERSON_NAMESPACE_URI)) {
        if (getRepository().containsPerson(uri)) {
          return new Person(model.getResource(uri));
        } else {
          return null;
        }
    } else {
      return findBySeeAlso(uri);
View Full Code Here

      Property o = model.createProperty(JenaSimalRepository.SIMAL_PERSON_URI);
      StmtIterator itr = model.listStatements(null, RDF.type, o);
      Set<IPerson> people = new HashSet<IPerson>();
      while (itr.hasNext()) {
        String uri = itr.nextStatement().getSubject().getURI();
        people.add(new Person(model.getResource(uri)));
      }
      return people;
  }
View Full Code Here

    if (reviewers.size() == 0) {
      throw new SimalException("No reviewer recorded for review: ");
    } else if (reviewers.size() > 1) {
      throw new SimalException("More than one reviewer recorded for review ");
    }
    IPerson reviewer = new Person(reviewers.get(0).getResource());
    return reviewer;
  }
View Full Code Here

TOP

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

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.