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

Examples of com.hp.hpl.jena.rdf.model.Resource.addProperty()


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


    final FormFile formFile = body.getFormFileParameterValues("file")[0];
    final String locationString = body.getTextParameterValues("location")[0];
    final Model editableModel = ModelFactory.createDefaultModel();
    final Resource infoBitResource = editableModel.createResource();
   
    infoBitResource.addProperty(DISCOBITS.mediaType, formFile
        .getMimeType().toString());
    infoBitResource.addProperty(DISCOBITS.bytes, editableModel
        .createTypedLiteral(formFile.getContent()));
    infoBitResource.addProperty(RDF.type, DISCOBITS.InfoBit);
    store.perform(identity, new StoreTransaction() {
View Full Code Here

    final Model editableModel = ModelFactory.createDefaultModel();
    final Resource infoBitResource = editableModel.createResource();
   
    infoBitResource.addProperty(DISCOBITS.mediaType, formFile
        .getMimeType().toString());
    infoBitResource.addProperty(DISCOBITS.bytes, editableModel
        .createTypedLiteral(formFile.getContent()));
    infoBitResource.addProperty(RDF.type, DISCOBITS.InfoBit);
    store.perform(identity, new StoreTransaction() {

      public void execute(SourceStoreView storeView) {
View Full Code Here

   
    infoBitResource.addProperty(DISCOBITS.mediaType, formFile
        .getMimeType().toString());
    infoBitResource.addProperty(DISCOBITS.bytes, editableModel
        .createTypedLiteral(formFile.getContent()));
    infoBitResource.addProperty(RDF.type, DISCOBITS.InfoBit);
    store.perform(identity, new StoreTransaction() {

      public void execute(SourceStoreView storeView) {
        NamedNode locationNode = new NamedNodeImpl(locationString);
        FCAGraph origGraph = storeView.getGraph().filter(
View Full Code Here

            Collections.singleton((GroundedNode) locationNode));
        Model origModel = ModelFactory.createModelForGraph(origGraph);
        editableModel.add(origModel);
        Resource locationResource = editableModel
            .createResource(locationString);
        locationResource.addProperty(RDF.type, DISCOBITS.InfoDiscoBit);
        locationResource.removeAll(DISCOBITS.infoBit);
        locationResource.addProperty(DISCOBITS.infoBit, infoBitResource);
        storeView.revokeGraph(origGraph);
        storeView.assertGraph(new FCAGraphImpl(editableModel));
      }
View Full Code Here

        editableModel.add(origModel);
        Resource locationResource = editableModel
            .createResource(locationString);
        locationResource.addProperty(RDF.type, DISCOBITS.InfoDiscoBit);
        locationResource.removeAll(DISCOBITS.infoBit);
        locationResource.addProperty(DISCOBITS.infoBit, infoBitResource);
        storeView.revokeGraph(origGraph);
        storeView.assertGraph(new FCAGraphImpl(editableModel));
      }

    });
View Full Code Here

      // introduce intermediate bnode
      Resource object = m.createResource();
      stmt = m.createStatement(subject,prop,object);
      RDFNode ym = schema.yearMonthDuration(m,value);
      RDFNode dt = schema.dayTimeDuration(m,value);
      if (ym!=null) object.addProperty(RDF.value, ym);
      if (dt!=null) object.addProperty(RDF.value, dt);
    }
    else if (type.endsWith("#ENTITY")) {
      DocumentType doctype = elem.getOwnerDocument().getDoctype();
      Pattern entityPattern = Pattern.compile("<!ENTITY\\s+"+value+"\\s+'(.*)'>");
 
View Full Code Here

      Resource object = m.createResource();
      stmt = m.createStatement(subject,prop,object);
      RDFNode ym = schema.yearMonthDuration(m,value);
      RDFNode dt = schema.dayTimeDuration(m,value);
      if (ym!=null) object.addProperty(RDF.value, ym);
      if (dt!=null) object.addProperty(RDF.value, dt);
    }
    else if (type.endsWith("#ENTITY")) {
      DocumentType doctype = elem.getOwnerDocument().getDoctype();
      Pattern entityPattern = Pattern.compile("<!ENTITY\\s+"+value+"\\s+'(.*)'>");
      Matcher match = entityPattern.matcher(doctype.getInternalSubset());
View Full Code Here

    model.setNsPrefix("db", DbMap.NS);
    model.setNsPrefix("ex", namespace);

    Resource map = model.createResource(namespace + "map");

    map.addProperty(RDF.type, DbMap.Map);

    Resource serverR = model.createResource(server);
    serverR.addProperty(RDF.type, DbMap.Database);
    serverR.addProperty(DbMap.user, user);
    serverR.addProperty(DbMap.pass, pass);
View Full Code Here

    Resource map = model.createResource(namespace + "map");

    map.addProperty(RDF.type, DbMap.Map);

    Resource serverR = model.createResource(server);
    serverR.addProperty(RDF.type, DbMap.Database);
    serverR.addProperty(DbMap.user, user);
    serverR.addProperty(DbMap.pass, pass);
    serverR.addProperty(DbMap.driver, driver);

    ResultSet rs = null;
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.