private void processStringPattern(Sheet sheet, int row) throws Exception {
   DefinedStringPattern prim = new DefinedStringPattern();
   prim.setCode(sheet.getColumn(row, "Data Type"));
   prim.setDefinition(sheet.getColumn(row, "Definition"));
   prim.setComment(sheet.getColumn(row, "Comments"));
   prim.setRegex(sheet.getColumn(row, "RegEx"));
   prim.setSchema(sheet.getColumn(row, "Schema"));
   prim.setBase(sheet.getColumn(row, "Base"));
   TypeRef td = new TypeRef();
   td.setName(prim.getCode());
   definitions.getKnownTypes().add(td);
   definitions.getPrimitives().put(prim.getCode(), prim);
 }
Exemplo n.º 2
0
 private void gen(DefinedStringPattern t) {
   Section section = section(t.getCode());
   section.triple("fhir:" + t.getCode(), "rdfs:subClassOf", "fhir:" + t.getBase());
   section.comment("fhir:" + t.getCode(), t.getDefinition());
   nilInstance.predicate("a", "fhir:" + t.getCode());
   section.triple(
       "fhir:" + t.getCode() + ".value", "rdfs:subPropertyOf", "fhir:" + t.getBase() + ".value");
   if (t.getSchema().endsWith("+")) {
     section.triple(
         "fhir:" + t.getCode() + ".value",
         "rdfs:range",
         t.getSchema().substring(0, t.getSchema().length() - 1));
     section.triple(
         "fhir:" + t.getCode() + ".value",
         "owl:withRestriction",
         complex().predicate("xs:pattern", literal(t.getRegex())));
   } else section.triple("fhir:" + t.getCode() + ".value", "rdfs:range", t.getSchema());
 }