예제 #1
0
 private static void printModel(OntModel model, Property prop) {
   StmtIterator stit = model.listStatements();
   Statement st = null;
   while (stit.hasNext()) {
     st = stit.next();
     if (prop == null || prop.equals(st.getPredicate())) {
       System.out.println("S: " + st.getSubject());
       System.out.println("P: " + st.getPredicate());
       System.out.println("O: " + st.getObject());
     }
   }
 }
예제 #2
0
 @Override
 public void visitComponentProperty(Property property, Resource resource, ComponentType... types) {
   if (resource == null) return;
   if (property == null) {
     out.printResourceStart(resource);
     super.visitComponentProperty(property, resource, types);
     out.printResourceEnd();
   } else if (resource.isAnon()) {
     // boolean isRefObjectMap = property.equals(RR.objectMap) &&
     //		mapping.referencingObjectMaps().has(resource);
     // d2.1
     boolean isRefObjectMap = property.equals(RR.objectMap);
     out.printPropertyStart(property, COMPACT_PROPERTIES.contains(property) && !isRefObjectMap);
     super.visitComponentProperty(property, resource, types);
     out.printPropertyEnd();
   } else {
     out.printProperty(property, resource);
   }
 }