Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model


 
  public void testFGNodeMerging() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hullo'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
View Full Code Here


  //FIX BaseStoreImp revokegraph
  public void notYetTestPartialFGNodeRevoke() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox \"foo\"; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
    FCAGraph graph2 = new FCAGraphImpl(model2);
View Full Code Here

 
  public void testPartialFGNodeRevoke2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model1b = modelWithStatements("_a http://xmlns.com/foaf/0.1/mbox \"foo\"; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");
    Model model2 = modelWithStatements("_a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/mbox_sha1sum '49f9f8e38c3144e19e09c3e5fa10170242d1360f'");

    Date date1 = dateFormat.parse("20050607");
    Date date1b = dateFormat.parse("20050608");
    Date date2 = dateFormat.parse("20060912");
    FCAGraph graph1 = new FCAGraphImpl(model1);
View Full Code Here

 
  public void testTransactions1() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/");
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
    clock.setTime(date1);
View Full Code Here

 
  public void testTransactions2() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/");
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
View Full Code Here

 
  public void testTransactions3() throws Exception {
    DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
    ToyClock clock = new ToyClock();
    Store store = getStoreImpl(clock);
    Model model1 = modelWithStatements("_a dc:subject 'sub1'; _a dc:subject 'hello'; _a http://xmlns.com/foaf/0.1/knows http://example.org/; _c dc:subject 'foo'");
    final FCAGraph graph1 = new FCAGraphImpl(model1);
    Model model2 = modelWithStatements("_b dc:subject 'sub2'; _b dc:subject 'hello'; _b http://xmlns.com/foaf/0.1/knows http://example.org/");
    final FCAGraph graph2 = new FCAGraphImpl(model2);
    Source source = new SourceImpl("http://example.org/graph-source");
    Date date1 = dateFormat.parse("20050607");
    Date date2 = dateFormat.parse("20050608");
    Date date3 = dateFormat.parse("20060912");
View Full Code Here

  private static Processor getProcessor(final int modelOrdinal) throws IOException {
    final PipedProcessor result =  new PipedProcessor();
    new Thread() {
      public void run() {   
        try {
          Model model = ModelFactory.createDefaultModel();
          model.read(result.in,"");
          OutputStream out = new FileOutputStream("test18-m"+modelOrdinal+".rdf");
          model.write(out, "");
          out.close();
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
View Full Code Here

  /* (non-Javadoc)
   * @see com.hp.hpl.jena.gvs.services.Service#start()
   */
  public void start() {
    Graph trustedGraph = store.getGraphOverTime(trustedSources).getGraph(new Date());
    Model trustedModel = JenaUtil.getModelFromGraph(trustedGraph);
    final Resource configRes = trustedModel.getResource(configuration.getURIRef());
    try {
      GVSServerLauncher.launchGVSServer(store, new ServerBinding() {
        public InetAddress getInetAddress() {
          Statement nicStatement = configRes.getProperty(HTTPLISTENER.networkInterface);
          if (nicStatement != null) {
View Full Code Here

   * @param username
   * @return
   */
  private Resource getUserResource(String username) {
    Graph graph  = configGOT.getGraph(new Date());
    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator resIter = model.listSubjectsWithProperty(ACCOUNTMANAGER.userName, username);
    if (resIter.hasNext()) {
      return resIter.nextResource();
    } else {
      return model.createResource();
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.hp.hpl.jena.gvs.services.http.graphserver.GraphHandler#getGraph(org.wymiwyg.wrhapi.Request)
   */
  public void handle(Request request, TypedResponse<Graph> response) throws HandlerException {
    Set<Source> sources = store.getSources();
    Model resultModel = ModelFactory.createDefaultModel();
    for (Source source : sources) {
      Resource sourceRes = resultModel.createResource(source.getURIRef());
      sourceRes.addProperty(RDF.type, METAMODEL.Source);
    }
    Subject subject = Subject.getSubject(AccessController.getContext());
    Set<GVSPrincipal> gvsPrincipals = subject.getPrincipals(GVSPrincipal.class);
    for (GVSPrincipal principal : gvsPrincipals) {
      resultModel.add(org.wymiwyg.commons.jena.JenaUtil.getExpandedResource(principal.getUserResource(), 2));
    }
    response.setBody(JenaUtil.getGraphFromModel(resultModel, true));
  }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.Model

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.