Package com.hp.hpl.jena.gvs

Examples of com.hp.hpl.jena.gvs.Source


      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
    Set<Source> trustedSources = getTrustedSources(serviceResource);
    Source identity = new SourceImpl(serviceResource.getRequiredProperty(SERVICES.identity).getResource().getURI());
    trustedSources.add(identity); //trust yourself
    NamedNode configuration = new NamedNodeImpl(serviceResource.getRequiredProperty(SERVICES.configuration).getResource().getURI());
    final Service service  = serviceFactory.getService(store, identity, trustedSources, configuration);
    new Thread() {
      public void run() {
View Full Code Here


  }

  protected void performTestsWithGraphs(FCAGraph[] graphs) {
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Source source = new SourceImpl("http://example.org/graph-source");
    TimedGraphSequence tgs = TimedGraphSequence
        .getSequenceWithRandomDates(graphs);
    for (int i = 0; i < tgs.getSize(); i++) {
      clock.setTime(tgs.getDate(i));
      store.updateGraph(source, tgs.getGraph(i));
View Full Code Here

        return 8686;
      }

    };

    Source identity =new SourceImpl("http://example.org/tests/identity");
    Set<Source> trustedSources  = new HashSet<Source>();
    NamedNode configuration = new NamedNodeImpl("http://example.org/tests/identity");;
    WebServer webServer = GVSServerLauncher.launchGVSServer(store, serverBinding, identity ,
        trustedSources, configuration);
View Full Code Here

    };
    URL sourceURL = new URL("http://"
        + serverBinding.getInetAddress().getHostName() + ":"
        + serverBinding.getPort() + "/danbri");
    Source identity = new SourceImpl("http://example.org/tests/identity");
    Set<Source> trustedSources  = new HashSet<Source>();
    trustedSources.add(identity);
    NamedNode configuration = new NamedNodeImpl("http://example.org/tests/configuration#");
    Model authorizationModel = ModelFactory.createDefaultModel();
    Resource user = authorizationModel.createResource(FOAF.Agent);
View Full Code Here

    };
    URL sourceURL = new URL("http://"
        + serverBinding.getInetAddress().getHostName() + ":"
        + serverBinding.getPort() + "/danbri");
    Source identity = new SourceImpl("http://example.org/tests/identity");
    Set<Source> trustedSources  = new HashSet<Source>();
    trustedSources.add(identity);
    NamedNode configuration = new NamedNodeImpl("http://example.org/tests/configuration#");
    Model authorizationModel = ModelFactory.createDefaultModel();
    Resource user = authorizationModel.createResource(FOAF.Agent);
View Full Code Here

  public boolean performTest(FCAGraph[] graphs) {
    try {
      for (int k = 0; k < 10; k++) {
        ToyClock clock = new ToyClock();
        Store store = new MemoryStoreImpl(clock);
        Source source = new SourceImpl(
            "http://example.org/graph-source");
        for (int i = 0; i < graphs.length; i++) {
          //TODO leanify on dec
          graphs[i] = new FCAGraphImpl(MoleculeBasedLeanifier
              .getLeanVersionOf(graphs[i]));
View Full Code Here

      StmtIterator seeAlsoStmt = currentModel.listStatements(null, RDFS.seeAlso, (Resource)null);
      while(seeAlsoStmt.hasNext()) {
        Statement stmt = seeAlsoStmt.nextStatement();
        RDFNode object = stmt.getObject();
        try {
          Source seeAlsoSource = new SourceImpl(((Resource)object).getURI());
          if (trustedSources.contains(seeAlsoSource)) {
            continue;
          }
          if (!store.getSources().contains(seeAlsoSource)) {
            downloadSource(seeAlsoSource);
View Full Code Here

        lang = "N3";
      }
    }
    model.read(fileURLString, lang);
    Graph graph = JenaUtil.getGraphFromModel(model, true);
    Source identity = arguments.getIdentity();
    store.assertGraph(identity, new FCAGraphImpl(graph))
  }
View Full Code Here

    if (request.getRequestURI().getPath().equals("/gvs")) {
      gvsService(request, moment, resourceURIStrings, response);
    } else {
      EnhancedRequest ehRequest = new EnhancedRequest(request);
      URL sourceURL = ehRequest.getRequestURLWithoutParams();
      Source source = new SourceImpl(sourceURL.toString());
      if (request.getMethod().equals(Method.GET) && (!store.getSources().contains(source))) {
        unavailableSourceGetHandler.handle(request, response);
      } else {
        gvsSourceHandle(request, source, moment, resourceURIStrings,
            response);
View Full Code Here

      String[] resourceURIStrings, TypedResponse<Graph> response)
      throws HandlerException {
    if (sources.size() != 1) {
      throw new RuntimeException("Must PUT as exactly one source");
    }
    Source source = sources.iterator().next();
    Model bodyModel = ModelFactory.createDefaultModel();
    try {
      bodyModel.read(Channels.newInputStream(request.getMessageBody()
          .read()), source.getURIRef());
    } catch (Exception e) {
      throw new HandlerException(e);
    }
    final FCAGraph graph = new FCAGraphImpl(bodyModel);
    if (resourceURIStrings != null) {
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.gvs.Source

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.