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

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


      while (allRolesIter.hasNext()) {
        allRolesSet.add(allRolesIter.next());
      }
      final Set<NonLiteral> nonBaseRolesSet = new HashSet<NonLiteral>();
      for (NonLiteral role : allRolesSet) {
        if (!systemGraph.filter(role, RDF.type, PERMISSION.BaseRole).hasNext()) {
          nonBaseRolesSet.add(role);
        }
      }
      return nonBaseRolesSet.iterator();
    } finally {
View Full Code Here


  public Iterator<NonLiteral> getRolesOfUser(NonLiteral user){
    LockableMGraph systemGraph = getSystemGraph();
    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      final Iterator<Triple> triples = systemGraph.filter(user,SIOC.has_function, null);
      Set<NonLiteral> userRoles = new HashSet<NonLiteral>();
      while (triples.hasNext()) {
        userRoles.add((NonLiteral) triples.next().getObject());
      }
      return userRoles.iterator();
View Full Code Here

  private void deleteTriplesOfASubject(NonLiteral subject) {
    LockableMGraph systemGraph = getSystemGraph();
    Lock writeLock = systemGraph.getLock().writeLock();
    writeLock.lock();
    try {
      Iterator<Triple> triples = systemGraph.filter(subject, null, null);
      while (triples.hasNext()) {
        triples.next();
        triples.remove();
      }
    } finally {
View Full Code Here

    LockableMGraph systemGraph = getSystemGraph();
    PlainLiteral javaPermEntry = new PlainLiteralImpl(permissionString);
    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> javaPermTriples = systemGraph.filter(null,
          PERMISSION.javaPermissionEntry, javaPermEntry);
      if (javaPermTriples.hasNext()) {
        return javaPermTriples.next().getSubject();
      }
    } finally {
View Full Code Here

  public Iterator<NonLiteral> getPermissionsOfRole(NonLiteral role) {
    LockableMGraph systemGraph = getSystemGraph();
    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      final Iterator<Triple> triples = systemGraph.filter(role,
          PERMISSION.hasPermission, null);
      Set<NonLiteral> permissions = new HashSet<NonLiteral>();
      while (triples.hasNext()) {
        permissions.add((NonLiteral) triples.next().getObject());
      }
View Full Code Here

        try {
            ResultSet resultSet = tcManager.executeSparqlQuery(selectQuery, enhancementGraph);
            while (resultSet.hasNext()) {
                SolutionMapping mapping = resultSet.next();
                UriRef ref = (UriRef) mapping.get("enhID");
                Iterator<Triple> tripleItr = enhancementGraph.filter(ref, null, null);
                while (tripleItr.hasNext()) {
                    Triple triple = tripleItr.next();
                    willBeRemoved.add(triple);
                }
            }
View Full Code Here

        try {
            final LockableMGraph permissionMGraph = tcManager.getMGraph(permissionGraphName);
            Lock l = permissionMGraph.getLock().readLock();
            l.lock();
            try {
                Triple t = permissionMGraph.filter(tripleCollectionUri, property, null).next();
                NonLiteral list = (NonLiteral) t.getObject();
                LinkedList<String> result = new LinkedList<String>();
                readList(list, permissionMGraph, result);
                return result;
            } catch (NoSuchElementException e) {
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.