@Nullable private static UID getUID(@Nullable String ns, RDFSClass<?> componentType) { ID id = componentType.getId(); if (id instanceof UID) { UID uid = (UID) id; String prefix = uid.ns().substring(uid.ns().lastIndexOf('/') + 1, uid.ns().length() - 1); if (Strings.isNullOrEmpty(ns)) { ns = uid.ns(); } return new UID(ns, prefix + "-" + uid.ln() + "-TypedList"); } else { return null; } }
public ClassMappingImpl(UID id, Class<?> parent) { this(id.getNamespace(), id.getLocalName(), parent); }
public static UID getContainerMembershipProperty(int i) { if (i < 1) { throw new IllegalArgumentException("Negative index: " + i); } return new UID(NS, "_" + i); }
@Test public void UIDString() { UID uid = new UID(RDF.type.getId()); assertEquals(RDF.NS, uid.getNamespace()); assertEquals("type", uid.getLocalName()); }
@Override public String toString() { return uid.getId(); } }
public boolean isString() { return datatype.equals(XSD.stringType); }
public String getLocalName() { return ln(); }
if (!(exportNamespaces.isEmpty() || exportNamespaces.contains(cuid.ns()))) { owlClass = new ReferenceClass(cuid); } else { resources.put(cuid, owlClass); owlClass.setLabel(Locale.ROOT, cuid.getLocalName()); } else { return owlClass; for (Object constant : clazz.getEnumConstants()) { Enum enumValue = (Enum) constant; oneOf.add(new AnyThing(new UID(cuid.ns(), enumValue.name()), owlClass, enumValue.ordinal()));
@Override @SuppressWarnings("unchecked") public ID getId(Object instance) { if (instance instanceof LID) { return identityService.getID((LID) instance); } else { MappedClass mappedClass = configuration.getMappedClass(getClass(assertMapped(instance))); if (instance.getClass().isEnum()) { return new UID(mappedClass.getUID().ns(), ((Enum) instance).name()); } else { BeanMap beanMap = toBeanMap(instance); return getId(mappedClass, beanMap); } } }
public String getClassNs() { return uid != null ? uid.ns() : ""; }
public MappedPredicate(String parentNs, Predicate predicate, @Nullable String elementName) { this.uid = UID.create(parentNs, predicate.ns(), predicate.ln(), elementName); this.inv = predicate.inv(); this.ignoreInvalid = predicate.ignoreInvalid(); this.includeInferred = predicate.includeInferred(); if (predicate.context().isEmpty()) { this.context = null; } else { this.context = new UID(predicate.context()); } }
MappedPredicate mappedPredicate = mappedPath.get(0); UID puid = mappedPredicate.getUID(); String predicateNs = puid.ns(); property = new DatatypeProperty(puid); property.setLabel(Locale.ROOT, puid.getLocalName()); resources.put(puid, property); processClass(session, mappedProperty.getComponentType(), resources); if (useTypedLists && componentType != null) { property.addRange(new TypedList(cuid.ns(), componentType));
protected void appendFull(UID uid) throws IOException { appendable.append("<").append(uid.getValue()).append(">"); }
private String getPackage(UID id) { if (nsToPackage.containsKey(id.getNamespace())) { return nsToPackage.get(id.getNamespace()); } else { throw new IllegalArgumentException("No package declared for " + id.getNamespace()); } }
protected UID getDatatypeUID(String datatype) { UID uid = datatypeUIDCache.get(datatype); if (uid == null) { uid = new UID(datatype); datatypeUIDCache.put(datatype, uid); } return uid; }
@Override public String getURI() { return XSD.byteType.getId(); } });