Examples of OntModel


Examples of com.hp.hpl.jena.ontology.OntModel

      String msgPrefix, CommandLine cmd) {
//     create an ontology model with no reasoner and the default doc manager
    OntModelSpec dullOWL =
      new OntModelSpec(null, dm, null, ProfileRegistry.OWL_LANG);
   
    OntModel m =
      ModelFactory.createOntologyModel(
          dullOWL);
        m.read(url,lang);
        chk.add(m);
    return results(chk, msgPrefix, cmd);
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

      String msgPrefix, CommandLine cmd) {
//     create an ontology model with no reasoner and the default doc manager
    OntModelSpec dullOWL =
      new OntModelSpec(null, dm, null, ProfileRegistry.OWL_LANG);
   
    OntModel m =
      ModelFactory.createOntologyModel(
          dullOWL);

    m.read(in, "urn:x-jena:syntaxchecker", lang);
    chk.add(m);
    return results(chk, msgPrefix, cmd);
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel


   */
 
  public void subClass(Resource c, schema.type type, Context ctx) {
    OntModel ont = (OntModel) c.getModel();
    Resource superclass = null;
    XMLBean b = get_baseType(ont,ctx);
   
    if (b!=null && b instanceof simpleType)
      superclass = ((simpleType) b).toOWL(ctx);
    else if (b!=null && b instanceof complexType)
      superclass = ((complexType) b).toOWL(null,true,ctx);
    else if (base != null) {
      String t = expandQName(ctx.getDefaultNS(),base, ont);
      if (t.startsWith(schema.XSD_URI)) {
        if (type==schema.type.simpleType) superclass = schema.toOWL(ont,t);
     
      // extension as superclass can only be done in a context where classes are defined by intersection
      else superclass = ont.getResource(t);
    }
   
    // this ignores xs:anyType extensions which are null
    if (superclass!=null) c.addProperty(RDFS.subClassOf,superclass);

    // is this consistent
    if (!ctx.checkConsistency(c,ont.getBaseModel())) {
      schema.removeSubClass(ont,c,superclass);
      String subject = c.getLocalName();
      if (subject==null) subject = "anonymous";
      Gloze.logger.warn(subject+" invalid subClassOf "+superclass.getLocalName());
    }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    List<Rule> l = Rule.parseRules(Rule.rulesParserFromReader(br));
    GenericRuleReasoner r = new GenericRuleReasoner(l);
    r.setTraceOn(trace!=null && trace.equals("true"));
    ctx.setReasoner(r);
   
    OntModel m = xs.toOWL(target, name, false, ctx);
//    ctx.getModel().write(System.out,"RDF/XML-ABBREV");
    return m;
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    List l = Rule.parseRules(Rule.rulesParserFromReader(br));
    GenericRuleReasoner r = new GenericRuleReasoner(l);
    r.setTraceOn(trace!=null && trace.equals("true"));
    ctx.setReasoner(r);
   
    OntModel m = xs.toOWL(target, name, false, ctx);
//    ctx.getModel().write(System.out,"RDF/XML-ABBREV");
    return m;
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    reasoner = new GenericRuleReasoner(rules);     
  }

  @Test public void testAll() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/all.xsd"));
    checkConsistency(m,new File(rdf+"/allElement.rdf"));
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    runTest(new File(xsd+"/annotation.xsd"));
  }

  @Test public void testAttribute() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/attribute.xsd"));
    checkConsistency(m,new File(rdf+"/attributeDatatype.rdf"));
    checkConsistency(m,new File(rdf+"/attributeForm.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroup.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroupAnyAttribute.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroupAttribute.rdf"));
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    checkConsistency(m,new File(rdf+"/attributeSimpleType.rdf"));
  }

  @Test public void testAttributeGroup() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/attributeGroup.xsd"));
    checkConsistency(m,new File(rdf+"/attributeGroup.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroupAnyAttribute.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroupAttribute.rdf"));
    checkConsistency(m,new File(rdf+"/attributeGroupAttributeGroup.rdf"));
  }
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    checkConsistency(m,new File(rdf+"/attributeGroupAttributeGroup.rdf"));
  }

  @Test public void testChoice() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/choice.xsd"));
    checkConsistency(m,new File(rdf+"/choiceAny.rdf"));
    checkConsistency(m,new File(rdf+"/choiceChoice.rdf"));
    checkConsistency(m,new File(rdf+"/choiceElement.rdf"));
    checkConsistency(m,new File(rdf+"/choiceElementMax.rdf"));
    checkConsistency(m,new File(rdf+"/choiceGroup.rdf"));
View Full Code Here

Examples of com.hp.hpl.jena.ontology.OntModel

    checkConsistency(m,new File(rdf+"/choiceSequence.rdf"));
  }

  @Test public void testComplexContent() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/complexContent.xsd"));
    checkConsistency(m,new File(rdf+"/complexContentExtension.rdf"));
    checkConsistency(m,new File(rdf+"/complexContentRestriction.rdf"));
  }
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.