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

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


      Resource obj = null;
      if (elem.hasAttributeNS(XML,"id")) {
        String id = elem.getAttributeNS(XML,"id");
        obj = m.createResource(addFragment(ctx.getBaseMap(), id).toString());
      }
      else obj = m.createResource();
     
      // explicit xsi:type
      if (elem.hasAttributeNS(schema.XSI,"type")) {
        String t = elem.getAttributeNS(schema.XSI,"type");
        String fullname = expandQName(ctx.getDefaultNS(),t,elem,ctx.getModel());
View Full Code Here


        String t = elem.getAttributeNS(schema.XSI,"type");
        String fullname = expandQName(ctx.getDefaultNS(),t,elem,ctx.getModel());
        complexType c = ctx.getComplexType(fullname);
        if (c!=null) {
          String id = c.getID(elem,ctx);
          Resource o = id==null?m.createResource():m.createResource(addFragment(ctx.getBaseMap(), id).toString());
          stmt = m.createStatement(subject,prop,o);
          // the new resource, o, becomes the subject
                   
          Seq subSeq = null;
          if (ctx.isSequenced() && elem.hasChildNodes() && c.needSeq(new HashSet<String>(), ctx))
View Full Code Here

        String t = elem.getAttributeNS(schema.XSI,"type");
        String fullname = expandQName(ctx.getDefaultNS(),t,elem,ctx.getModel());
        complexType c = ctx.getComplexType(fullname);
        if (c!=null) {
          String id = c.getID(elem,ctx);
          Resource o = id==null?m.createResource():m.createResource(addFragment(ctx.getBaseMap(), id).toString());
          stmt = m.createStatement(subject,prop,o);
          // the new resource, o, becomes the subject
                   
          Seq subSeq = null;
          if (ctx.isSequenced() && elem.hasChildNodes() && c.needSeq(new HashSet<String>(), ctx))
View Full Code Here

    if (t!=null && t.startsWith(schema.XSD_URI)) {
      // ID is used to name the owning element - don't generate RDF property
      if (t.endsWith("#ID")) return;
      // IDREF to globally named element
      else if (t.endsWith("#IDREF")) {
        Resource rez = model.createResource(addFragment(ctx.getBaseMap(), value).toString());
        subject.addProperty(prop, rez);
      }
      // IDREFS to global entities
      else if (t.endsWith("#IDREFS"))
        subject.addProperty(prop, schema.toRDFList(attribute,value,XSD.IDREF.getURI(),null,ctx));
View Full Code Here

    throws Exception {
    Model m = subject.getModel();
    schema xs = (schema) this.get_owner();
   
    if (name != null && addType)
      subject.addProperty(RDF.type, m.createResource(createURI(m,ctx)));
   
    // add the attributes
    if (_attribute!=null) xs.toRDF(subject, elem, _attribute, ctx);
   
    for (int i = 0; attributeGroup != null && i < attributeGroup.length; i++)
View Full Code Here

    return complex;
  }

  public void assertType(Resource subject, Context ctx) {
    Model m = subject.getModel();
    subject.addProperty(RDF.type, m.createResource(createURI(m,ctx)));
    if (complexContent!=null) complexContent.assertType(subject,ctx);
  }
 
  public boolean subtype(String type, Model model, Context ctx) {
    if (complexContent!=null) return complexContent.subtype(type, model, ctx);
View Full Code Here

        // Find the right starting point for the description in some way.
        Resource root = null ;

        if ( false )
            // If you know the Resource URI:
            root = spec.createResource("http://example/myChoiceOfURI" );
        else
        {
            // Alternatively, look for the a single resource of the right type.
            try {
                // Find the required description - the file can contain descriptions of many different types.
View Full Code Here

        }
        Node resAsNode = old.asNode() ;
        Model model = old.getModel() ;
        Graph graph = model.getGraph() ;
        Graph rawGraph = graph instanceof InfGraph ? ((InfGraph) graph).getRawGraph() : graph ;
        Resource newRes = model.createResource(uri) ;
        Node newResAsNode = newRes.asNode() ;
        
       
        boolean changeOccured = false ;
        List<Triple> triples = new ArrayList<Triple>(WINDOW_SIZE) ;
View Full Code Here

                    Resource dss = model.createResource(ParserUtil.dssURI + code);

                    model.add(eurostatDatasetURI, ParserUtil.voidSubset, dss);
                    model.add(dss, ParserUtil.type, ParserUtil.voidDataset);
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/data/" + code + ".rdf"));
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/dsd/" + code + ".rdf"));
                }
            }
        }
View Full Code Here

                    Resource dss = model.createResource(ParserUtil.dssURI + code);

                    model.add(eurostatDatasetURI, ParserUtil.voidSubset, dss);
                    model.add(dss, ParserUtil.type, ParserUtil.voidDataset);
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/data/" + code + ".rdf"));
                    model.add(dss, model.createProperty(ParserUtil.voidURI + "dataDump"), model.createResource("http://eurostat.linked-statistics.org/dsd/" + code + ".rdf"));
                }
            }
        }

        writeRDFToFile("void", model);
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.