@Override public R getResource(ID id) { if (id.isURI()) { return getURI(id.asURI()); } else { return getBNode(id.asBNode()); } }
public void export(Session session, File targetFolder) throws IOException { List<EntityType> entityTypes = new ArrayList<EntityType>(); // collect entity types for (OWLClass owlClass : session.findInstances(OWLClass.class)) { if (owlClass.getId().isURI()) { EntityType entityType; if (oneOfAsEnum && !owlClass.getOneOf().isEmpty()) { entityType = createEnumType(owlClass); } else { entityType = createBeanType(owlClass); } entityTypes.add(entityType); } } // serialize BeanSerializer beanSerializer = new BeanSerializer(); beanSerializer.setPrintSupertype(true); for (EntityType entityType : entityTypes) { File folder = new File(targetFolder, entityType.getPackageName().replace('.', '/')); folder.mkdirs(); File javaFile = new File(folder, entityType.getSimpleName() + ".java"); javaFile.createNewFile(); Writer writer = new OutputStreamWriter(new FileOutputStream(javaFile), "UTF-8"); try { beanSerializer.serialize(entityType, SimpleSerializerConfig.DEFAULT, new JavaWriter(writer)); } finally { writer.close(); } } }
if (restriction.getAllValuesFrom() != null && restriction.getAllValuesFrom().getId().isURI()) { RDFSClass<?> range = restriction.getAllValuesFrom(); if (properties.containsKey(rdfProperty)) {
} else if (requiredClass.isEnum() && subject.isURI()) { return (T) Enum.valueOf((Class) requiredClass, subject.asURI().ln());
private Type getPropertyType(RDFProperty rdfProperty, @Nullable RDFSClass<?> range) { Type propertyType = typeMapping.getDefaultType(); if (localizedProperties.contains(rdfProperty.getId())) { propertyType = typeMapping.get(RDF.text); } else if (range != null) { if (typeMapping.containsKey(range.getId())) { propertyType = typeMapping.get(range.getId()); } else if (range.getId().isURI()) { UID id = (UID) range.getId(); String pkgName = getPackage(id); String simpleName = getClassName(id); propertyType = new SimpleType(TypeCategory.SIMPLE, pkgName + "." + simpleName, pkgName, simpleName, false, false); } } if (propertyAsList.contains(rdfProperty.getId())) { propertyType = new SimpleType(Types.LIST, propertyType); } else if (propertyAsSet.contains(rdfProperty.getId())) { propertyType = new SimpleType(Types.LIST, propertyType); } return propertyType; }
if (subject.isURI() && configuration.isRestricted((UID) subject)) { return subject;
if (stmt.getSubject().isURI()) { writer.append(" rdf:about=\"" + shorten(stmt.getSubject().asURI()) + "\">\n"); } else {
identifier = getLID(subject); } else if (idType == IDType.URI) { if (subject.isURI()) { identifier = subject; } else {