Examples of createResource()


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

    }
    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

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

      }
    }
    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

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

    value = processWhitespace(node,value,itemType,ctx);

    if (itemType!=null && itemType.equals(XSD_URI+"#QName")) {
      String name = expandQName(ctx.getDefaultNS(),null,value,node,ctx.getModel());
      if (name==null) return null; // one bad value invalidates the entire list
      else object = m.createResource(name);
    }
    else if (itemType!=null && itemType.equals(XSD.IDREF.getURI())) {
      if (value.indexOf(':')>=0) return null; // avoid confusion with QNames
      object = ctx.getModel().createResource(addFragment(ctx.getBaseMap(), value).toString());
    }
View Full Code Here

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

    model.setNsPrefix("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
    model.setNsPrefix("owl", "http://www.w3.org/2002/07/owl");
    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);
View Full Code Here

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

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

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

    String ex = model.getNsPrefixURI("ex");

    while (rs.next()) {
      String tableName = rs.getString("TABLE_NAME");
      Resource tableRes = model
          .createResource(ex + tableName, RDFS.Class);
      map.addProperty(DbMap.mapsClass, tableRes);
      tableRes.addProperty(DbMap.database, serverR);
      tableRes.addProperty(DbMap.table, tableName);
View Full Code Here

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

      ResultSet cols = md.getColumns(null, null, tableName, null);
      while (cols.next()) {
        String colName = cols.getString("COLUMN_NAME");
        String type = cols.getString("TYPE_NAME");
        Resource col = model.createResource(ex + tableName + "_"
            + colName, RDF.Property);
        col.addProperty(RDFS.domain, tableRes);
        col.addProperty(DbMap.col, colName);
        col.addProperty(DbMap.colType, type);
      }
View Full Code Here

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

      ResultSet forkeys = md.getExportedKeys(null, null, tableName);
      while (forkeys.next()) {
        String colName = forkeys.getString("PKCOLUMN_NAME");
        String fColName = forkeys.getString("FKCOLUMN_NAME");
        String fTableName = forkeys.getString("FKTABLE_NAME");
        Resource col = model.createResource(ex + tableName + "_"
            + colName, RDF.Property);
        Resource fcol = model.createResource(ex + fTableName + "_"
            + fColName, RDF.Property);
        col.addProperty(DbMap.foreignKey, fcol);
      }
View Full Code Here

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

        String colName = forkeys.getString("PKCOLUMN_NAME");
        String fColName = forkeys.getString("FKCOLUMN_NAME");
        String fTableName = forkeys.getString("FKTABLE_NAME");
        Resource col = model.createResource(ex + tableName + "_"
            + colName, RDF.Property);
        Resource fcol = model.createResource(ex + fTableName + "_"
            + fColName, RDF.Property);
        col.addProperty(DbMap.foreignKey, fcol);
      }
      forkeys.close();
           
View Full Code Here

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

           
      ResultSet rowIdentifiers = md.getPrimaryKeys(null, null, tableName);
      while (rowIdentifiers.next())
      {
        String colName = rowIdentifiers.getString("COLUMN_NAME");
        Resource col = model.createResource(ex + tableName + "_"
            + colName, RDF.Property);
        tableRes.addProperty(DbMap.primaryKey, col);
      }
    }
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.