Package org.apache.clerezza.rdf.utils

Examples of org.apache.clerezza.rdf.utils.GraphNode$Acceptor


      resultGraph.add(new TripleImpl(customfield, USERMANAGER.role,
          new PlainLiteralImpl(role)));
      resultGraph.add(new TripleImpl(propertyManagementPage,
          CUSTOMPROPERTY.customfield, customfield));
    }
    return new GraphNode(propertyManagementPage, new UnionMGraph(
        resultGraph, contentGraph));
  }
View Full Code Here


  }

  private void addAvailableRoles(GraphNode result) {
    Iterator<NonLiteral> roles = userManager.getRoles();
    while (roles.hasNext()) {
      GraphNode role = new GraphNode(roles.next(), systemGraph);
      result.addProperty(USERMANAGER.role, role.getNode());
      addCustomPropertiesOfRole(role, result);
    }
  }
View Full Code Here

    Lock readLock = systemGraph.getLock().readLock();
    readLock.lock();
    try {
      Iterator<Triple> baseRoles = systemGraph.filter(null, RDF.type, PERMISSION.BaseRole);
      if (baseRoles.hasNext()) {
        GraphNode baseRole = new GraphNode(baseRoles.next().getSubject(), systemGraph);
        result.addProperty(USERMANAGER.role, baseRole.getNode());
        addCustomPropertiesOfRole(baseRole, result);
      }
    } finally {
      readLock.unlock();
    }
View Full Code Here

  @Path("get")
  public GraphNode getDiscobit(@QueryParam("resource") UriRef uri,
      @QueryParam("graph") UriRef graphUri) {
    final MGraph mGraph = graphUri == null ? cgProvider.getContentGraph() :
      tcManager.getMGraph(graphUri);
    return new GraphNode(uri, mGraph);
  }
View Full Code Here

 
  @Override
  public void put(UriRef infoDiscoBitUri, MediaType mediaType,
      byte[] data) {

    GraphNode infoDiscoBitNode;
    final LockableMGraph mGraph = (LockableMGraph) getMGraph();
    infoDiscoBitNode = new GraphNode(infoDiscoBitUri, mGraph);
    CollectionCreator collectionCreator = new CollectionCreator(mGraph);
    collectionCreator.createContainingCollections(infoDiscoBitUri);
    Lock writeLock = mGraph.getLock().writeLock();
    writeLock.lock();
    try {
      infoDiscoBitNode.addProperty(RDF.type, DISCOBITS.InfoDiscoBit);
      TypedLiteral dataLiteral = LiteralFactory.getInstance().createTypedLiteral(data);
      infoDiscoBitNode.deleteProperties(DISCOBITS.infoBit);
      infoDiscoBitNode.addProperty(DISCOBITS.infoBit, dataLiteral);
      TypedLiteral mediaTypeLiteral = LiteralFactory.getInstance().createTypedLiteral(mediaType.toString());
      infoDiscoBitNode.deleteProperties(DISCOBITS.mediaType);
      infoDiscoBitNode.addProperty(DISCOBITS.mediaType,mediaTypeLiteral);
    } finally {
      writeLock.unlock();
    }
    Set<MetaDataGenerator> metaDataGenerators = getMetaDataGenerators();
    synchronized(metaDataGenerators) {
View Full Code Here

    while (properties.hasNext()) {
      Triple triple = properties.next();
      UriRef predicate = triple.getPredicate();
      if (predicate.equals(DISCOBITS.contains)) {
        try {
          GraphNode containedNode = new GraphNode((NonLiteral)triple.getObject(), mGraph);
          //The following includes triple
          containedNode.deleteNodeContext();
        } catch (ClassCastException e) {
          throw new RuntimeException("The value of "+predicate+" is expected not to be a literal");
        }
        //as some other properties of node could have been in the context of the object
        remove(node);
        return;
      }     
    }
    GraphNode graphNode = new GraphNode(node, mGraph);
    graphNode.deleteNodeContext();
  }
View Full Code Here

  }

  @Override
  public byte[] getData(UriRef uriRef) {
    MGraph mGraph = getMGraph();
    GraphNode node = new GraphNode(uriRef, mGraph);
    final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
    if (infoDiscobit == null) {
      return null;
    }
    return infoDiscobit.getData();
View Full Code Here

  }

  @Override
  public MediaType getMediaType(UriRef uriRef) {
    MGraph mGraph = getMGraph();
    GraphNode node = new GraphNode(uriRef, mGraph);
    final InfoDiscobit infoDiscobit = InfoDiscobit.createInstance(node);
    if (infoDiscobit == null) {
      return null;
    }
    return MediaType.valueOf(infoDiscobit.getContentType());
View Full Code Here

    MGraph mGraph = new SimpleMGraph();
    NonLiteral overview = new BNode();
    mGraph.add(new TripleImpl(overview, RDF.type, DASHBOARD.DashBoard));
    mGraph.add(new TripleImpl(overview, RDF.type, PLATFORM.HeadedPage));
    return new GraphNode(overview, mGraph);
  }
View Full Code Here

    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
   
    GraphNode scriptNode = null;
    if(script != null){
      scriptNode = getScript(script);
      resultGraph.add(new TripleImpl(resultResource,
          SCRIPTMANAGER.script,
          scriptNode.getNode()));
    }
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ScriptManagerOverviewPage));
    GraphNode scriptList = getScriptList(resultResource);

    UnionMGraph unionGraph = null;
    if(scriptNode != null){
      unionGraph = new UnionMGraph(resultGraph, scriptList.getGraph(),
          scriptNode.getGraph(), contentGraph);
    } else {
      unionGraph = new UnionMGraph(resultGraph, scriptList.getGraph(),
        contentGraph);
    }
   
    return new GraphNode(resultResource, unionGraph);
  }
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.utils.GraphNode$Acceptor

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.