Package org.apache.clerezza.rdf.utils

Examples of org.apache.clerezza.rdf.utils.GraphNode.readLock()


    return AccessController.doPrivileged(new PrivilegedAction<UriRef>() {

      @Override
      public UriRef run() {
        GraphNode platformInstance = getPlatformInstance();
        Lock l = platformInstance.readLock();
        l.lock();
        try {
          Iterator<Resource> triples = platformInstance.getObjects(PLATFORM.defaultBaseUri);
          if (triples.hasNext()) {
            return (UriRef) triples.next();
View Full Code Here


  }

  private boolean isBaseRole(NonLiteral role) {
    LockableMGraph systemGraph = getSystemGraph();
    GraphNode roleNode = new GraphNode(role, systemGraph);
    Lock readLock = roleNode.readLock();
    readLock.lock();
    try {
      return roleNode.hasProperty(RDF.type, PERMISSION.BaseRole);
    } finally {
      readLock.unlock();
View Full Code Here

    }
    GraphNode infoBitNode = new GraphNode(infoBitUri, cgProvider.getContentGraph());
    UriRef thumbnailUri = getGeneratedThumbnailUri(infoBitNode, width, height, exact);
    if (thumbnailUri == null) {
      Literal mediaTypeLiteral = null;
      Lock readLock = infoBitNode.readLock();
      readLock.lock();
      try {
        Iterator<Resource> mediaTypes = infoBitNode.getObjects(DISCOBITS.mediaType);
        if (mediaTypes.hasNext()) {
          mediaTypeLiteral = (Literal) mediaTypes.next();
View Full Code Here

          }
          for (Resource resource : indexedResources) {
            GraphNode node = new GraphNode(resource, e.getGraph());
            List<UriRef> types = new ArrayList<UriRef>();
            Lock lock = node.readLock();
            lock.lock();
            try {
              Iterator<Resource> resources = node.getObjects(RDF.type);
              while (resources.hasNext()) {
                Resource res = resources.next();
View Full Code Here

  private void followInversePaths(Resource resource, List<UriRef> pathToIndexedResource, List<Resource> list) {
    if (pathToIndexedResource.isEmpty()) {
      list.add(resource);
    } else {
      GraphNode node = new GraphNode(resource, this.baseGraph);
      Lock lock = node.readLock();
      lock.lock();
      try {
        Iterator<NonLiteral> predecessors = node.getSubjects(pathToIndexedResource.get(0));

        List<UriRef> tail = pathToIndexedResource.subList(1, pathToIndexedResource.size());
View Full Code Here

    writer.deleteDocuments(term);
    //the reindexing might be caused by the removal of a type statement

    GraphNode node = new GraphNode(uriRef, this.baseGraph);
    List<UriRef> types = new ArrayList<UriRef>();
    Lock lock = node.readLock();
    lock.lock();
    try {
      Iterator<Resource> resources = node.getObjects(RDF.type);
      while (resources.hasNext()) {
        Resource res = resources.next();
View Full Code Here

                    }
                    for (Resource resource : indexedResources) {
                        GraphNode node = new GraphNode(resource, e.getGraph());
                        List<UriRef> types = new ArrayList<UriRef>();
                        Lock lock = node.readLock();
                        lock.lock();
                        try {
                            Iterator<Resource> resources = node.getObjects(RDF.type);
                            while (resources.hasNext()) {
                                Resource res = resources.next();
View Full Code Here

    private void followInversePaths(Resource resource, List<UriRef> pathToIndexedResource, List<Resource> list) {
        if (pathToIndexedResource.isEmpty()) {
            list.add(resource);
        } else {
            GraphNode node = new GraphNode(resource, this.baseGraph);
            Lock lock = node.readLock();
            lock.lock();
            try {
                Iterator<NonLiteral> predecessors = node.getSubjects(pathToIndexedResource.get(0));

                List<UriRef> tail = pathToIndexedResource.subList(1, pathToIndexedResource.size());
View Full Code Here

        writer.deleteDocuments(term);
        //the reindexing might be caused by the removal of a type statement

        GraphNode node = new GraphNode(uriRef, this.baseGraph);
        List<UriRef> types = new ArrayList<UriRef>();
        Lock lock = node.readLock();
        lock.lock();
        try {
            Iterator<Resource> resources = node.getObjects(RDF.type);
            while (resources.hasNext()) {
                Resource res = resources.next();
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.