Package org.apache.clerezza.rdf.core

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


    }
    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 {
      readLock.unlock();
    }
    handler.put(new UriRef(uri), formFile.getMediaType(), content);
    return Response.created(URI.create(uri)).build();
 
View Full Code Here


      propertiesSet.add(properties.next());
    }
    properties = propertiesSet.iterator();
    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) {
View Full Code Here

    File dataDir = File.createTempFile("test", "externalizer");
    dataDir.delete();
    dataDir.mkdir();
    ExternalizingMGraph graph = new ExternalizingMGraph(new SimpleMGraph(), dataDir);
    TypedLiteral lit = new TypedLiteralImpl("jkjkj", ExternalizingMGraph.base64Uri);
    UriRef replacement = graph.replace(lit);
    TypedLiteral reconstructed = graph.getLiteralForUri(replacement.getUnicodeString());
    Assert.assertEquals(replacement, graph.replace(reconstructed));
  }
View Full Code Here

  private void loadGraphs() {
    File graphsDir = new File(new File(dataPathString), "graph");
    if (graphsDir.exists()) {
      for (String graphDirName : graphsDir.list()) {
        try {
          UriRef uri = new UriRef(URLDecoder.decode(graphDirName, "utf-8"));
          log.info("loading: "+graphDirName);
          graphMap.put(uri, getGraph(new File(graphsDir, graphDirName)));
        } catch (UnsupportedEncodingException ex) {
          throw new RuntimeException("utf-8 not supported", ex);
        } catch (Exception e) {
View Full Code Here

  private void loadMGraphs() {
    File mGraphsDir = new File(new File(dataPathString), "mgraph");
    if (mGraphsDir.exists()) {
      for (String mGraphDirName : mGraphsDir.list()) {
        try {
          UriRef uri = new UriRef(URLDecoder.decode(mGraphDirName, "utf-8"));
          log.info("loading: "+mGraphDirName);
          mGraphMap.put(uri, new LockableMGraphWrapper(getMGraph(new File(mGraphsDir, mGraphDirName))));
        } catch (UnsupportedEncodingException ex) {
          throw new RuntimeException("utf-8 not supported", ex);
        } catch (Exception e) {
View Full Code Here

    }
  }

  private boolean attemptRegistration(RegistrationRequest registrationRequest) {
    final String renderletServiceName = registrationRequest.renderletServiceName;
    UriRef renderingSpecification = registrationRequest.renderingSpecification;
    final UriRef rdfType = registrationRequest.rdfType;
    final String modePattern = registrationRequest.mode;
    final MediaType mediaType = registrationRequest.mediaType;

    final Renderlet renderlet = renderletMap.get(renderletServiceName);
    if (renderlet == null) {
View Full Code Here

    NonLiteral subject = triple.getSubject();
    if (subject instanceof UriRef) {
      subject = replacePlaceHolder((UriRef) subject);
    }
    UriRef predicate = replacePlaceHolder(triple.getPredicate());

    Resource object = triple.getObject();
    if (object instanceof UriRef) {
      object = replacePlaceHolder((UriRef) object);
    } else if (object instanceof TypedLiteral) {
View Full Code Here

        bundleSymbolicName = orig.subSequence(
            BASE_URI_PLACEHOLDER.length(), nextSlash).toString();
      } else {
        bundleSymbolicName = originBundleSymbName;
      }
      return new UriRef(baseUri + "bundle-doc/" + bundleSymbolicName +
          orig.substring(nextSlash));
    }
    return uriRef;
  }
View Full Code Here

  protected void activate(ComponentContext cCtx) throws Exception {
    logger.debug("Activating DashBoard")
 
    URL template = getClass().getResource("dashboard-template.ssp");
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(template.toURI().toString()), DASHBOARD.DashBoard,
        "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
  }
View Full Code Here

        resourceDir.getFile());

    fileServer = new FileServer(pathNode);
    URL renderlet = getClass().getResource("scriptmanager-script-overview.ssp");
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.ScriptManagerOverviewPage,
        "naked", MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderlet = getClass().getResource("scriptmanager-script-list.xhtml");
    renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.ScriptList,
        "naked" , MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderlet = getClass().getResource("scriptmanager-script-install.ssp");
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.ScriptManagerInstallPage,
        "naked" , MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderlet = getClass().getResource("scriptmanager-execution-uri-overview.ssp");
    renderletManager.registerRenderlet(ScalaServerPagesRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.ExecutionUriOverviewPage,
        "naked" , MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderlet = getClass().getResource("scriptmanager-execution-uri-list.xhtml");
    renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.ExecutionUriList,
        "naked" , MediaType.APPLICATION_XHTML_XML_TYPE, true);
    renderlet = getClass().getResource("scriptmanager-script-information.xhtml");
    renderletManager.registerRenderlet(SeedsnipeRenderlet.class.getName(),
        new UriRef(renderlet.toURI().toString()),
        SCRIPTMANAGER.SelectedScript,
        "naked" , MediaType.APPLICATION_XHTML_XML_TYPE, true);

  }
View Full Code Here

TOP

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

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.