private static Node convert(ALiteral lit) { String dtURI = lit.getDatatypeURI(); if (dtURI == null) return NodeFactory.createLiteral(lit.toString(), lit.getLang()); if (lit.isWellFormedXML()) { return NodeFactory.createLiteral(lit.toString(), null, true); } RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(dtURI); return NodeFactory.createLiteral(lit.toString(), dt); }
@Override public void statement(AResource a, AResource b, ALiteral l){ /* this method is invoked exactly once * while parsing the dummy document. * The l argument is in exclusive canonical XML and * corresponds to where the lexical form has been * in the dummy document. The lexical form is valid * iff it is unchanged. */ if (status[1] || !l.isWellFormedXML()) { status[0] = true; } //throw new BrokenException("plain literal in XMLLiteral code."); status[1] = true; status[2] = l.toString().equals(lexicalForm); } @Override
private Literal convert(ALiteral lit) { String dt = lit.getDatatypeURI(); if (dt == null) return model.createLiteral(lit.toString(), lit.getLang()); else return model.createTypedLiteral(lit.toString(), dt); }
@Override public void statement(AResource sub, AResource pred, ALiteral lit) { TopicIF topic = getSubject(sub); // FIXME: support xml:lang here? TopicNameIF bn = builder.makeTopicName(topic, lit.toString()); addScope(bn); } }
static private void literal(ALiteral l) { //if (l.isWellFormedXML()) // System.out.print("xml"); line.append('"'); escape(l.toString()); line.append('"'); String lang = l.getLang(); if (lang != null && !lang.equals("")) { line.append('@'); print(lang); } String dt = l.getDatatypeURI(); if (dt != null && !dt.equals("")) { print("^^<"); escapeURI(dt); line.append('>'); } line.append(' '); }
@Override public void statement(AResource a, AResource b, ALiteral l){ /* this method is invoked exactly once * while parsing the dummy document. * The l argument is in exclusive canonical XML and * corresponds to where the lexical form has been * in the dummy document. The lexical form is valid * iff it is unchanged. */ if (status[1] || !l.isWellFormedXML()) { status[0] = true; } //throw new BrokenException("plain literal in XMLLiteral code."); status[1] = true; status[2] = l.toString().equals(lexicalForm); } @Override
@Override public void statement(AResource sub, AResource pred, ALiteral lit) { TopicIF topic = getSubject(sub); TopicIF ourtype = type; if (ourtype == null) ourtype = getPredicate(pred); OccurrenceIF occ = builder.makeOccurrence(topic, ourtype, lit.toString()); addScope(occ); } }
private static Node convert(ALiteral lit) { String dtURI = lit.getDatatypeURI(); if (dtURI == null) return NodeFactory.createLiteral(lit.toString(), lit.getLang()); if (lit.isWellFormedXML()) { return NodeFactory.createLiteral(lit.toString(), null, true); } RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(dtURI); return NodeFactory.createLiteral(lit.toString(), dt); }
static private void literal(ALiteral l) { //if (l.isWellFormedXML()) // System.out.print("xml"); line.append('"'); escape(l.toString()); line.append('"'); String lang = l.getLang(); if (lang != null && !lang.equals("")) { line.append('@'); print(lang); } String dt = l.getDatatypeURI(); if (dt != null && !dt.equals("")) { print("^^<"); escapeURI(dt); line.append('>'); } line.append(' '); }
private static Node convert(ALiteral lit) { String dtURI = lit.getDatatypeURI(); if (dtURI == null) return NodeFactory.createLiteral(lit.toString(), lit.getLang()); if (lit.isWellFormedXML()) { return NodeFactory.createLiteral(lit.toString(), null, true); } RDFDatatype dt = TypeMapper.getInstance().getSafeTypeByName(dtURI); return NodeFactory.createLiteral(lit.toString(), dt); }