public IRI sameDocRef() { if (sameDocRef==null){ sameDocRef = iriFactory().create(""); } return sameDocRef; }
/** * Creates new XMLContext * * @throws SAXParseException */ XMLContext(XMLHandler h, String base) throws SAXParseException { this(h, h.iriFactory().create(base)); }
/** * Creates new XMLContext * * @throws SAXParseException */ XMLContext(XMLHandler h, String base) throws SAXParseException { this(h, h.iriFactory().create(base)); }
public OutputStream openOutput(String str) { OutputStream foo = (OutputStream) open(iriFactory.create(str), false); // System.out.println(foo.toString()); return foo; }
@Override public void add(String prefix, String iriString) { prefix = canonicalPrefix(prefix); IRI iri = IRIResolver.iriFactory().create(iriString); prefixes.put(prefix, iri); uriToPrefix.put(iriString, prefix) ; }
private IRI resolveSilentNoCache(String uriStr) { IRI x = IRIResolver.iriFactory().create(uriStr); if ( SysRIOT.AbsURINoNormalization ) { // Always process "file:", even in strict mode. // file: is widely used in irregular forms. if ( x.isAbsolute() && ! uriStr.startsWith("file:") ) return x; } return base.create(x); }
static private IRI resolveIRI(String relStr, String baseStr) { IRI i = factory.create(relStr); if (i.isAbsolute()) // removes excess . segments return cwd.create(i); IRI base = factory.create(baseStr); if ("file".equalsIgnoreCase(base.getScheme())) return cwd.create(base).create(i); return base.create(i); }
private void testIRI(String uriStr) { IRI iri = factory.create(uriStr) ; CheckerIRI.iriViolations(iri, handler) ; }
/** * A lazy open. The I/O only starts, and resources * are only allocated on first read. * @param str The URI to open */ public InputStream open(String str) { return open(iriFactory.create(str)); } /**
public OutputStream openOutput(String str) { OutputStream foo = (OutputStream) open(iriFactory.create(str), false); // System.out.println(foo.toString()); return foo; }
/** * A lazy open. The I/O only starts, and resources * are only allocated on first read. * @param str The URI to open */ public InputStream open(String str) { return open(iriFactory.create(str)); } /**
public OutputStream openOutput(String str) { OutputStream foo = (OutputStream) open(iriFactory.create(str), false); // System.out.println(foo.toString()); return foo; }
public final boolean checkURI(Node node, long line, long col) { if ( cache != null && cache.containsKey(node) ) return true ; IRI iri = iriFactory.create(node.getURI()) ; // always works - no exceptions. boolean b = checkIRI(iri, line, col) ; // If OK, put in cache. if ( cache != null && b ) cache.put(node, iri) ; return b ; }
public static URIReference fromQName(Frame f, String ns, String local) throws SAXParseException { URIReference rslt = new URIReference(ns + local); f.checkEncoding(rslt,local); // TODO: not for 2.3 move some of the check upwards ... IRI iri = f.arp.iriFactory().create(ns+local); AbsXMLContext.checkURI(f.arp,rslt,iri); return rslt; }
Test(Resource r) { super( WGTestSuite .this .testDir .relativize(IRIFactory.iriImplementation().create(r.getURI()), IRI.CHILD) .toString()); testID = r; } String create(Property p) {
Test(Resource r) { super( WGTestSuite .this .testDir .relativize(IRIFactory.iriImplementation().create(r.getURI()), IRI.CHILD) .toString()); testID = r; } String create(Property p) {
public void testURI(String uri, boolean ok) { IRI ref = factory.create(uri); if (ok && ref.hasViolation(false)) { Violation v = ref.violations(false).next(); fail("<" + uri + "> is expected to be a URI, but: "+v.getLongMessage()); } assertEquals("<" + uri + "> is"+(ok?" ":" not ")+"a URI", ok, !ref.hasViolation(false)); } public void testNoDomain() {
public void testURI(String uri, boolean ok) { IRI ref = factory.create(uri); if (ok && ref.hasViolation(false)) { Violation v = ref.violations(false).next(); fail("<" + uri + "> is expected to be a URI, but: "+v.getLongMessage()); } assertEquals("<" + uri + "> is"+(ok?" ":" not ")+"a URI", ok, !ref.hasViolation(false)); } public void testNoDomain() {