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

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


        String BASE = "http://example/" ;
        Model model = ModelFactory.createDefaultModel() ;
        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;
        Property p1 = model.createProperty(BASE+"p") ;
        Property p2 = model.createProperty(BASE+"p2") ;
        RDFNode v1 = model.createTypedLiteral("1", XSDDatatype.XSDinteger) ;
        RDFNode v2 = model.createTypedLiteral("2", XSDDatatype.XSDinteger) ;
       
        r1.addProperty(p1, v1).addProperty(p1, v2) ;
View Full Code Here


        Model model = ModelFactory.createDefaultModel() ;
        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;
        Property p1 = model.createProperty(BASE+"p") ;
        Property p2 = model.createProperty(BASE+"p2") ;
        RDFNode v1 = model.createTypedLiteral("1", XSDDatatype.XSDinteger) ;
        RDFNode v2 = model.createTypedLiteral("2", XSDDatatype.XSDinteger) ;
       
        r1.addProperty(p1, v1).addProperty(p1, v2) ;
        r1.addProperty(p2, v1).addProperty(p2, v2) ;
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

    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

    Model m = ctx.getModel();
    String value = getValue(elem);
    if (value==null && _default != null) value = _default;
    String uri = createURI(m,ctx);
    Property prop = null;
    if (uri != null) prop = m.createProperty(uri);
    Statement stmt=null;
    // the element may be defined locally or globally (follow ref)
    element def = getDefinition(ctx.getModel(),ctx);
   
    // explicit xsi:type
View Full Code Here

  throws Exception {
    Model m = subject.getModel();
    Statement stmt = null;
   
    String uri = expandQName(elem, ctx.getModel(), ctx);
    Property prop = m.createProperty(uri);

    // anything with no attributes and a single (or no) value is simple
    // anything with attributes is complex
    // anything with children is complex
   
View Full Code Here

    schema xs = (schema) this.get_owner();
    if (attribute==null && getFixed()==null) return;
   
    String value = attribute!=null?attribute.getValue():getFixed();
    if (value.equals("") && _default!=null) value = _default;
    Property prop = model.createProperty(createURI(model,ctx));
   
    // avoid adding xml namespace attributes
    if (attribute!=null &&
        attribute.getNamespaceURI()!=null &&
        attribute.getNamespaceURI().equals(XML)) return;
View Full Code Here

  /** check validity of simple content */
 
  public boolean isValid(Resource resource, Context ctx) {
    Model model = ctx.getModel();
    Property prop = model.createProperty(createURI(model,ctx));
    Statement stmt = resource.getProperty(prop);
    String value = stmt!=null?stmt.getString():null;
    attribute def = getDefinition(model,ctx);
    XMLBean t = def.get_type(ctx);
    if (t instanceof simpleType) return ((simpleType)t).isValid(value, ctx);
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.