Statement stmt = null;
if (type.endsWith("#ID")) ;
// ID is used to name the owning element - don't generate RDF
// IDREF to globally named element
else if (type.endsWith("#IDREF")) {
Resource r = m.createResource(addFragment(ctx.getBaseMap(), value).toString());
stmt = m.createStatement(subject,prop,r);
}
else if (type.endsWith("#IDREFS")) {
Resource r = toRDFList(elem,value,XSD.IDREF.getURI(),null,ctx);
stmt = m.createStatement(subject,prop,r);
}
else if (type.endsWith("#NMTOKENS")) {
Resource r = toRDFList(elem,value,XSD.NMTOKEN.getURI(),null,ctx);
stmt = m.createStatement(subject,prop,r);
}
else if (type.endsWith("#QName")) {
RDFNode object = null;
String name = XMLBean.expandQName(ctx.getDefaultNS(),null,value,elem,ctx.getModel());
if (name!=null) {
object = m.createResource(name);
stmt = m.createStatement(subject,prop,object);
}
}
else if (type.endsWith("#duration")) {
// map duration into separate xs:yearMonthDuration and xs:dayTimeDuration
// introduce intermediate bnode
Resource object = m.createResource();
stmt = m.createStatement(subject,prop,object);
RDFNode ym = schema.yearMonthDuration(m,value);
RDFNode dt = schema.dayTimeDuration(m,value);
if (ym!=null) object.addProperty(RDF.value, ym);
if (dt!=null) object.addProperty(RDF.value, dt);
}
else if (type.endsWith("#ENTITY")) {
DocumentType doctype = elem.getOwnerDocument().getDoctype();
Pattern entityPattern = Pattern.compile("<!ENTITY\\s+"+value+"\\s+'(.*)'>");
Matcher match = entityPattern.matcher(doctype.getInternalSubset());