Package org.apache.clerezza.rdf.core

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


  }

  private Resource createRandomResource() {
    switch (rollDice(3)) {
      case 0:
        return new BNode();
      case 1:
        return createRandomUriRef();
      case 2:
        return new PlainLiteralImpl(RandomStringUtils.random(rollDice(100) + 1));
    }
View Full Code Here


  public GraphNode overview(
      @QueryParam(value = "script") UriRef script) {

    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);
View Full Code Here

  @Produces("text/plain")
  public GraphNode getScript(
      @QueryParam(value = "script") UriRef scriptUri){

    AccessController.checkPermission(new ScriptManagerAppPermission());
    BNode resource = new BNode();
    MGraph resultGraph = new SimpleMGraph();


    resultGraph.add(new TripleImpl(resource,
        SCRIPTMANAGER.script,
View Full Code Here

  public GraphNode getScriptList(
      @QueryParam(value = "resource") NonLiteral resource) {

    AccessController.checkPermission(new ScriptManagerAppPermission());
    if(resource == null) {
      resource = new BNode();
    }

    BNode resultResource = new BNode();
    MGraph contentGraph = cgProvider.getContentGraph();
   
    MGraph additionGraph = new SimpleMGraph();

    UnionMGraph resultGraph = new UnionMGraph(additionGraph, contentGraph);
View Full Code Here

  @Path("script-install")
  public GraphNode install() {

    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ScriptManagerInstallPage));
    resultGraph.add(new TripleImpl(resultResource,
View Full Code Here

  private GraphNode getScriptLanguageList(NonLiteral resource){
    MGraph resultGraph = new SimpleMGraph();
    Iterator<ScriptLanguageDescription> it =
        scriptExecution.getInstalledScriptLanguages();
    while(it.hasNext()){
      BNode languageDescription = new BNode();
      ScriptLanguageDescription sld = it.next();
      resultGraph.add(new TripleImpl(resource,
          SCRIPTMANAGER.scriptLanguageDescription,
          languageDescription));
View Full Code Here

  @GET
  @Path("execution-uri-overview")
  public GraphNode getExecutionUriOverview() {
    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(resultResource,
View Full Code Here

  protected void unbindContextProvider(UserContextProvider provider) {
    contextProviders.remove(provider);
  }

  private GraphNode getUserContext() {
    GraphNode contextNode = new GraphNode(new BNode(), new SimpleMGraph());
    synchronized(contextProviders) {
      Iterator<UserContextProvider> providersIter = contextProviders.iterator();
      while (providersIter.hasNext()) {
        UserContextProvider userContextProvider = providersIter.next();
        contextNode = userContextProvider.addUserContext(contextNode);
View Full Code Here

  }

  private GraphNode addLanguages(GraphNode node, NonLiteral platformInstance, List<LanguageDescription> languages,
      boolean copyToNode) {
    TripleCollection graph = node.getGraph();
    BNode listNode = new BNode();   
    RdfList list = new RdfList(listNode, graph);
    LockableMGraph configGraph = getConfigGraph();
    Lock readLock = configGraph.getLock().readLock();
    for (LanguageDescription languageDescription : languages) {
      NonLiteral languageUri = (NonLiteral) languageDescription.getResource().getNode();
View Full Code Here

    TripleCollection tc = provider.getTriples(graphUriRef);
    assertNotNull(tc);
  }

  private Triple createTestTriple() {
    NonLiteral subject = new BNode() {};
    UriRef predicate = new UriRef("http://test.com/");
    NonLiteral object = new UriRef("http://test.com/myObject");
    return new TripleImpl(subject, predicate, object);
  }
View Full Code Here

TOP

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

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.