Package org.apache.clerezza.rdf.core.access

Examples of org.apache.clerezza.rdf.core.access.LockableMGraph.filter()


    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    Lock readLock = contentGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> formFields = contentGraph.filter(null, RDF.type,
          USERMANAGER.UserFormField);
      while (formFields.hasNext()) {
        resultGraph.add(new TripleImpl(addUserPage,
            CUSTOMPROPERTY.customfield, formFields.next().getSubject()));
      }
View Full Code Here


        NonLiteral user = getCustomUser(contentGraph, userName);
        if (user != null) {
          Lock readLock = contentGraph.getLock().readLock();
          readLock.lock();
          try {
            Iterator<Triple> values = contentGraph.filter(user,
                property, null);
            while (values.hasNext()) {
              Resource value = values.next().getObject();
              resultGraph.add(new TripleImpl(customField,
                  CUSTOMPROPERTY.actualvalues, value));
View Full Code Here

    NonLiteral user = getCustomUser(contentGraph, userName);
    if (user != null) {
      Lock writeLock = contentGraph.getLock().writeLock();
      writeLock.lock();
      try {
        Iterator<Triple> userTriples = contentGraph.filter(user, null, null);
        while (userTriples.hasNext()) {
          userTriples.next();
          userTriples.remove();
        }
      } finally {
View Full Code Here

        NonLiteral contentUser = getCustomUser(contentGraph, userName);

        Lock readLock = contentGraph.getLock().readLock();
        readLock.lock();
        try {
          Iterator<Triple> values = contentGraph.filter(contentUser,
              property, null);
          while (values.hasNext()) {
            PlainLiteral value = (PlainLiteral) values.next().getObject();
            resultGraph.add(new TripleImpl(customfield,
                CUSTOMPROPERTY.actualvalues, value));
View Full Code Here

    }
    Lock l = mGraph.getLock().writeLock();
    l.lock();
    try {
      Iterator<Triple> oldParentTripleIter
          = mGraph.filter(nodeUri, HIERARCHY.parent, null);
      if (oldParentTripleIter.hasNext()) {
        oldParentTripleIter.next();
        oldParentTripleIter.remove();
      }
      while (oldParentTripleIter.hasNext()) {
View Full Code Here

  private boolean nodeAtUriExists(UriRef nodeUri) {
    LockableMGraph mGraph = (LockableMGraph) getMGraph();
    Lock readLock = mGraph.getLock().readLock();
    readLock.lock();
    try {
      return mGraph.filter(nodeUri, null, null).hasNext()
          || mGraph.filter(null, null, nodeUri).hasNext();
    } finally {
      readLock.unlock();
    }
  }
View Full Code Here

    LockableMGraph mGraph = (LockableMGraph) getMGraph();
    Lock readLock = mGraph.getLock().readLock();
    readLock.lock();
    try {
      return mGraph.filter(nodeUri, null, null).hasNext()
          || mGraph.filter(null, null, nodeUri).hasNext();
    } finally {
      readLock.unlock();
    }
  }
View Full Code Here

    }
    LockableMGraph contentGraph = cgProvider.getContentGraph();
    Lock readLock = contentGraph.getLock().readLock();
    readLock.lock();
    try {
      if (contentGraph.filter(new UriRef(uri), RDF.type, null).hasNext()) {
        return Response.status(Response.Status.CONFLICT).
            entity("A resource with the specified URI already exists").
            type(MediaType.TEXT_PLAIN_TYPE).build();
      }
    } finally {
View Full Code Here

      String dependencyValue) {
    LockableMGraph contentGraph = cgProvider.getContentGraph();
    Lock lock = contentGraph.getLock().readLock();
    lock.lock();
    try {
      Iterator<Triple> collections = contentGraph.filter(null, RDF.type,
          CUSTOMPROPERTY.CustomFieldCollection);
      while (collections.hasNext()) {
        Iterator<Triple> collections2 = contentGraph
            .filter(collections.next().getSubject(),
                CUSTOMPROPERTY.dependency, dependency);
View Full Code Here

    lock.lock();
    try {
      Iterator<Triple> collections = contentGraph.filter(null, RDF.type,
          CUSTOMPROPERTY.CustomFieldCollection);
      while (collections.hasNext()) {
        Iterator<Triple> collections2 = contentGraph
            .filter(collections.next().getSubject(),
                CUSTOMPROPERTY.dependency, dependency);
        while (collections2.hasNext()) {
          Iterator<Triple> collections3 = contentGraph.filter(
              collections2.next().getSubject(),
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.