Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.Resource


  }

  private Set<Resource> createSet(Iterator<? extends Resource> resources) {
    Set<Resource> set = new HashSet<Resource>();
    while (resources.hasNext()) {
      Resource resource = resources.next();
      set.add(resource);
    }
    return set;
  }
View Full Code Here


    Lock l = node.readLock();
    l.lock();
    try {
      Iterator<Resource> objects = node.getObjects(RDFS.seeAlso);
      while (objects.hasNext()) {
        Resource next = objects.next();
        if (next instanceof UriRef) {
          result.add((UriRef)next);
        }
      }
    } finally {
View Full Code Here

  private void removeCachedConcepts(GraphNode conceptCacheEntryGraphNode) {
    Iterator<Resource> searchResults =
        conceptCacheEntryGraphNode.getObjects(CONCEPTS.searchResult);
    while (searchResults.hasNext()) {
      Resource concept = searchResults.next();
      GraphNode conceptGraphNode = new GraphNode(concept,
          conceptCacheEntryGraphNode.getGraph());
      conceptGraphNode.deleteProperties(OWL.sameAs);
      conceptGraphNode.deleteProperties(RDFS.comment);
      conceptGraphNode.deleteProperties(SKOS.prefLabel);
View Full Code Here

   * returns the surface in pixel if the image fits withing width and height,
   * or -1 if it doesn't fit
   */
  private int getSurfaceSizeIfFitting(GraphNode infoBitNode, Integer width, Integer height,
      boolean exact) {
    Resource imageRes = infoBitNode.getNode();
    if (imageRes instanceof UriRef) {
      String imageUri = ((UriRef)imageRes).getUnicodeString();
      if (!exact && imageUri.contains(AlternativeRepresentationGenerator.EXACT_APPENDIX)) {
        return -1;
      }
View Full Code Here

  private boolean fillMSG(Triple triple, TripleCollection tc,
      TripleCollection msg) {

    boolean containsBNode = false;

    Resource resource = triple.getSubject();
    if (resource instanceof BNode) {
      containsBNode = true;
    } else {
      resource = triple.getObject();
      if (resource instanceof BNode) {
View Full Code Here

        + "}";
    try {
      SelectQuery selectQuery = (SelectQuery) QueryParser.getInstance().parse(queryString);
      ResultSet result = tcManager.executeSparqlQuery(selectQuery, systemGraph);
      if (result.hasNext()) {
        Resource email = result.next().get("email");
        String emailString = ((UriRef) email).getUnicodeString();
        //TODO should add personal name (if available) as well
        return new InternetAddress(emailString.substring("mailto:".length()));
      }
    } catch (ParseException ex) {
View Full Code Here

            Lock lock = node.readLock();
            lock.lock();
            try {
              Iterator<Resource> resources = node.getObjects(RDF.type);
              while (resources.hasNext()) {
                Resource res = resources.next();
                if (res instanceof UriRef) {
                  types.add((UriRef) res);
                }
              }
            } finally {
View Full Code Here

    Lock lock = node.readLock();
    lock.lock();
    try {
      Iterator<Resource> resources = node.getObjects(RDF.type);
      while (resources.hasNext()) {
        Resource res = resources.next();
        if (res instanceof UriRef) {
          types.add((UriRef) res);
        }
      }
    } finally {
View Full Code Here

    Lock lock = node.readLock();
    lock.lock();
    try {
      Iterator<Resource> iter = node.getObjects(this.property);
      while(iter.hasNext()) {
        Resource resource = iter.next();
        if(resource instanceof Literal) {
          list.add(((Literal)resource).getLexicalForm());
        } else if(resource instanceof UriRef) {
          list.add(((UriRef) resource).getUnicodeString());
        }
View Full Code Here

   * @return TripleCollection
   */
  private Iterator<Triple> filter(TripleMatch m) {
    NonLiteral subject = null;
    UriRef predicate = null;
    Resource object = null;
    if (m.getMatchSubject() != null) {
      subject = jena2TriaUtil.convertNonLiteral(m.getMatchSubject());
      if (subject == null) {
        return Collections.EMPTY_SET.iterator();
      }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.Resource

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.