Examples of Gloze


Examples of com.hp.gloze.Gloze

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

  @Test public void testRestriction() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/restriction.xsd"));
    checkConsistency(m,new File(rdf+"/restrictionAll.rdf"));
    checkConsistency(m,new File(rdf+"/restrictionAnyAttribute.rdf"));
    checkConsistency(m,new File(rdf+"/restrictionAttribute.rdf"));
    checkConsistency(m,new File(rdf+"/restrictionAttributeGroup.rdf"));
View Full Code Here

Examples of com.hp.gloze.Gloze

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

  @Test public void testSequence() throws Exception {
    gloze = new Gloze(SILENT);
    gloze.closed="false";
    OntModel m = runTest(new File(xsd+"/sequence.xsd"));
    checkConsistency(m,new File(rdf+"/sequenceAny.rdf"));
    checkConsistency(m,new File(rdf+"/sequenceAnyLocal.rdf"));
    checkConsistency(m,new File(rdf+"/sequenceAnyOther.rdf"));
View Full Code Here

Examples of com.hp.gloze.Gloze

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

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

Examples of com.hp.gloze.Gloze

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

  @Test public void testSimpleType() throws Exception {
    gloze = new Gloze(SILENT);
    OntModel m = runTest(new File(xsd+"/simpleType.xsd"));
    checkConsistency(m,new File(rdf+"/simpleType.rdf"));
    checkConsistency(m,new File(rdf+"/simpleTypeList1.rdf"));
    checkConsistency(m,new File(rdf+"/simpleTypeList2.rdf"));
    checkConsistency(m,new File(rdf+"/simpleTypeList2Empty.rdf"));
View Full Code Here

Examples of com.hp.gloze.Gloze

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

  @Test public void testSubstitution() throws Exception {
    gloze = new Gloze(SILENT);
    runTest(new File(xsd+"/substitution.xsd"));
  }
View Full Code Here

Examples of com.hp.gloze.Gloze

    gloze = new Gloze(SILENT);
    runTest(new File(xsd+"/substitution.xsd"));
  }

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

Examples of com.hp.gloze.Gloze

    OntModel m = runTest(new File(xsd+"/union.xsd"));
    checkConsistency(m,new File(rdf+"/unionSimpleType.rdf"));
  }

  @Test public void testEcore() throws Exception {
    gloze = new Gloze(SILENT);
    runTest(new File(xsd+"/ecore.xsd"));
  }
View Full Code Here

Examples of com.hp.gloze.Gloze

        }     
        // load the target XML and initialise gloze with its schema
        Document xml = XMLUtility.read(new FileInputStream(list[i]));
       
        // lift and drop
        Gloze gloze = new Gloze(SILENT);
       
        // list[i] is the base, provide URL for additional imports/includes
        Model m = gloze.lift(xml, list[i].toURL(), list[i].toURI());
        Document doc = gloze.drop(m, list[i].toURI());
        if (positive) assertTrue(Utility.equalXML(xml,doc, true));
        else assertFalse(Utility.equalXML(xml,doc, true));
      } catch (Exception error) {
        fail(error.getMessage());
      }
View Full Code Here

Examples of com.hp.gloze.Gloze

    File[] list = xmlDir.listFiles();
    for (int i = 0; i < list.length; i++) {
      // skip over eg. CVS subdirectories
      if (list[i].isDirectory()) continue;

      Gloze gloze = new Gloze(SILENT);
      try {
        Gloze.logger.info("lift " + list[i].getName());
        String targetName = changeSuffix(list[i].getName(), "rdf");
        File targetRDF = new File(rdfDir, targetName);
        Model m = ModelFactory.createDefaultModel();
        // generate target RDF the first time
        Model output = ModelFactory.createDefaultModel();
        File target = targetRDF.exists()?null:targetRDF;
        URI base = XMLBean.resolveBase(uri,list[i]);
        gloze.xml_to_rdf(list[i], target, base, output);
        m.read(new FileInputStream(targetRDF), base.toString());
        assertTrue(m.isIsomorphicWith(output));
      } catch (Exception e) {
        Gloze.logger.error(e.getMessage());
      }
View Full Code Here

Examples of com.hp.gloze.Gloze

    File[] list = rdfDir.listFiles();
    for (int i = 0; i < list.length; i++) {
      // skip over eg. CVS subdirectories
      if (list[i].isDirectory() || !list[i].getName().endsWith("rdf")) continue;
     
      Gloze gloze = new Gloze(SILENT);

      try {
        Model m = ModelFactory.createDefaultModel();
        Gloze.logger.info("drop " + list[i].getName());
        String name = list[i].getName();
        // load the target XML and initialise gloze with its schema
        String targetName = name.substring(0,name.lastIndexOf('.') + 1) + "xml";
        File targetXML = new File(xmlDir, targetName);
        Document targetDoc = XMLUtility.read(new FileInputStream(targetXML));
        Gloze.initSchemaXSI(targetDoc.getDocumentElement(),xmlDir.toURL(),ns,gloze.schemaMap);
        Document target = XMLUtility.read(new FileInputStream(targetXML));
        // drop the rdf and compare with the target
        Document output = gloze.rdf_to_xml(list[i], null, XMLBean.resolveBase(uri,targetXML), m);
        assertTrue(Utility.equalXML(output,target, true));
      catch (Exception error) {
        fail(list[i].getName()+" : "+error.getMessage());
      }
    }
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.