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

Examples of com.hp.hpl.jena.rdf.model.Model.createResource()


   */
  private void writeMetaInf(File directory, NamedNode node, Resource type,
      Object component) throws IOException {
    File metaInfFile = new File(directory, "meta-inf");
    Model metaInfModel = ModelFactory.createDefaultModel();
    Resource componentRes = metaInfModel.createResource(node.getURIRef());
    componentRes.addProperty(RDF.type, type);
    componentRes.addProperty(METAMODEL.hashCode, metaInfModel
        .createTypedLiteral(component.hashCode()));

    OutputStream metaInfOut = new FileOutputStream(metaInfFile);
View Full Code Here


      directory.mkdirs();
      // writeMetaInf(directory, componentDirectory.getNode(),
      // METAMODEL.FunctionallyGroundedNode, functionallyGroundedNode);
      File metaInfFile = new File(directory, "meta-inf");
      Model metaInfModel = ModelFactory.createDefaultModel();
      Resource componentRes = metaInfModel
          .createResource(componentDirectory.getNode().getURIRef());
      componentRes.addProperty(RDF.type,
          METAMODEL.FunctionallyGroundedNode);
      componentRes.addProperty(METAMODEL.hashCode, metaInfModel
          .createTypedLiteral(functionallyGroundedNode.hashCode()));
View Full Code Here

          moleculeName = storeNTMolecule(molecule);
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
        componentRes.addProperty(METAMODEL.containsNonTerminalMolecule,
            metaInfModel.createResource(moleculeName.getURIRef()));
      }
      OutputStream metaInfOut = new FileOutputStream(metaInfFile);
      try {
        metaInfModel.write(metaInfOut, "N-TRIPLE");
      } finally {
View Full Code Here

    resultBuffer.append("/user/");
    resultBuffer.append(userName);
    // resultBuffer.append('#');
    String result = resultBuffer.toString();
    Model creationModel = ModelFactory.createDefaultModel();
    creationModel.createResource(result).addProperty(RDFS.comment,
        "login Link sent at " + new Date());
    store.assertGraph(new SourceImpl(result), new FCAGraphImpl(
        creationModel));
    return result;
  }
View Full Code Here

      throw new RuntimeException(e);
    }
    Date now = new Date();

    Model logEntryModel = ModelFactory.createDefaultModel();
    Resource downloadAttempt = logEntryModel
        .createResource(AGGREGATOR.DownloadAttempt);
    downloadAttempt.addProperty(AGGREGATOR.time, new W3CDateFormat()
        .format(now), XSDDatatype.XSDdateTime);
    downloadAttempt.addProperty(AGGREGATOR.aggregatedSource, logEntryModel
        .createResource(aggregatedSource.getURIRef()));
View Full Code Here

    Model logEntryModel = ModelFactory.createDefaultModel();
    Resource downloadAttempt = logEntryModel
        .createResource(AGGREGATOR.DownloadAttempt);
    downloadAttempt.addProperty(AGGREGATOR.time, new W3CDateFormat()
        .format(now), XSDDatatype.XSDdateTime);
    downloadAttempt.addProperty(AGGREGATOR.aggregatedSource, logEntryModel
        .createResource(aggregatedSource.getURIRef()));
    downloadAttempt.addProperty(AGGREGATOR.aggregator, logEntryModel
        .createResource(identity.getURIRef()));
    Graph logEntryGraph = JenaUtil.getGraphFromModel(logEntryModel, true);
    final StringWriter aggregationWarningWriter = new StringWriter();
View Full Code Here

        .createResource(AGGREGATOR.DownloadAttempt);
    downloadAttempt.addProperty(AGGREGATOR.time, new W3CDateFormat()
        .format(now), XSDDatatype.XSDdateTime);
    downloadAttempt.addProperty(AGGREGATOR.aggregatedSource, logEntryModel
        .createResource(aggregatedSource.getURIRef()));
    downloadAttempt.addProperty(AGGREGATOR.aggregator, logEntryModel
        .createResource(identity.getURIRef()));
    Graph logEntryGraph = JenaUtil.getGraphFromModel(logEntryModel, true);
    final StringWriter aggregationWarningWriter = new StringWriter();
    final StringWriter aggregationErrorWriter = new StringWriter();
    try {
View Full Code Here

    public Configuration(Store store, GraphOverTime configGOT,
        NamedNode configuration) {

      Graph configGraph = configGOT.getGraph(new Date());
      Model configModel = JenaUtil.getModelFromGraph(configGraph);
      Resource httpConfigRes = configModel.createResource(configuration
          .getURIRef());
      Statement amConfigStmt = httpConfigRes
          .getProperty(WEBACCOUNTMANAGER.webAccountManagerConfiguration);
      if (amConfigStmt != null) {
        Resource amConfigRes = amConfigStmt.getResource();
View Full Code Here

    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);
    user.addProperty(ACCOUNTMANAGER.userName, "beta");
    user.addProperty(ACCOUNTMANAGER.passwordSha1, Util.sha1("tester"));
    user.addProperty(AUTHORIZATION.mayImpersonate, authorizationModel.createResource(sourceURL.toString()));
    store.assertGraph(identity, new FCAGraphImpl(authorizationModel));
    WebServer webServer = GVSServerLauncher.launchGVSServer(store, serverBinding, identity ,
View Full Code Here

    NamedNode configuration = new NamedNodeImpl("http://example.org/tests/configuration#");
    Model authorizationModel = ModelFactory.createDefaultModel();
    Resource user = authorizationModel.createResource(FOAF.Agent);
    user.addProperty(ACCOUNTMANAGER.userName, "beta");
    user.addProperty(ACCOUNTMANAGER.passwordSha1, Util.sha1("tester"));
    user.addProperty(AUTHORIZATION.mayImpersonate, authorizationModel.createResource(sourceURL.toString()));
    store.assertGraph(identity, new FCAGraphImpl(authorizationModel));
    WebServer webServer = GVSServerLauncher.launchGVSServer(store, serverBinding, identity ,
        trustedSources, configuration);

    Model model = ModelFactory.createDefaultModel();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.