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

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


    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

      throws HandlerException {
    MultiPartBody body = ParameterUtil.parseMultipart(request);
    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()));
View Full Code Here

    }
   
    private static Model makeData()
    {
        Model model = ModelFactory.createDefaultModel() ;
        Resource r = model.createResource(NS+"r") ;
        Property p1 = model.createProperty(NS+"p1") ;
        Property p2 = model.createProperty(NS+"p2") ;
        model.add(r, p1, "xyz") ;
        model.add(r, p2, "abc") ;
        return model ;
View Full Code Here

    // this may be an ID embedded in element content
    else if (type!=null && type.equals(XSD_URI+"#ID")) {
      String uri = subject.isAnon()?null:subject.getURI();
      String frag = addFragment(ctx.getBaseMap(), value).toString();
      if (frag.equals(uri)) return true;
      else object = m.createResource(frag)
    }   
    else if (type!=null && type.equals(XSD_URI+"#IDREF"))
      object = m.createResource(addFragment(ctx.getBaseMap(), value).toString());   
   
    else if (type!=null && type.equals(XSD_URI+"#IDREFS"))
View Full Code Here

      String frag = addFragment(ctx.getBaseMap(), value).toString();
      if (frag.equals(uri)) return true;
      else object = m.createResource(frag)
    }   
    else if (type!=null && type.equals(XSD_URI+"#IDREF"))
      object = m.createResource(addFragment(ctx.getBaseMap(), value).toString());   
   
    else if (type!=null && type.equals(XSD_URI+"#IDREFS"))
      object = toRDFList(node,value,XSD.IDREF.getURI(),null,ctx);   

    else if (type!=null && type.equals(XSD_URI+"#ENTITIES"))
View Full Code Here

    else if (type!=null && type.equals(XSD_URI+"#ENTITIES"))
      object = toRDFList(node,value,XSD.ENTITY.getURI(),null,ctx);   

    else if (type!=null && (type.equals(XSD_URI+"#QName") || type.equals(XSD_URI+"#NOTATION")))
      object = m.createResource(expandQName(ctx.getDefaultNS(),value,node,ctx.getModel()));
   
    else if (type!=null && type.equals(XSD_URI+"#anyURI")) {
      URI uri = null;
      if (isValidURI(value)) uri = new URI(value);
      // it may be a relative URI
View Full Code Here

    Statement stmt = null;
    if (type.endsWith("#ID")) ;
    // ID is used to name the owning element - don't generate RDF
    // IDREF to globally named element
    else if (type.endsWith("#IDREF")) {
      Resource r = m.createResource(addFragment(ctx.getBaseMap(), value).toString());
      stmt = m.createStatement(subject,prop,r);
    }
    else if (type.endsWith("#IDREFS")) {
      Resource r = toRDFList(elem,value,XSD.IDREF.getURI(),null,ctx)
      stmt = m.createStatement(subject,prop,r);
View Full Code Here

    }
    else if (type.endsWith("#QName")) {
      RDFNode object = null;
      String name = XMLBean.expandQName(ctx.getDefaultNS(),null,value,elem,ctx.getModel());
      if (name!=null) {
        object = m.createResource(name);
        stmt = m.createStatement(subject,prop,object);
      }
    }
    else if (type.endsWith("#duration")) {
      // map duration into separate xs:yearMonthDuration and xs:dayTimeDuration
View Full Code Here

      }
    }
    else if (type.endsWith("#duration")) {
      // map duration into separate xs:yearMonthDuration and xs:dayTimeDuration
      // 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);
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.