static private String abbrevByBase(String uri, String base) { if ( base == null ) return null ; IRI baseIRI = IRIFactory.jenaImplementation().construct(base) ; IRI rel = baseIRI.relativize(uri, relFlags) ; String r = null ; try { r = rel.toASCIIString() ; } catch (MalformedURLException ex) { r = rel.toString() ; } return r ; }
/** * Validates a URI is indeed valid * @param uri * @return */ public static boolean isValidUri(String uri) { return !iriFactory.create(uri).hasViolation(false); }
/** Abbreviate the URI */ private String abbrevByBase(String uri) { IRI rel = iriResolver.relativize(uri, relFlags) ; String r = null ; try { r = rel.toASCIIString() ; } catch (MalformedURLException ex) { r = rel.toString() ; } return r ; }
Test(Resource r) { super( WGTestSuite .this .testDir .relativize(IRIFactory.iriImplementation().create(r.getURI()), IRI.CHILD) .toString()); testID = r; } String create(Property p) {
/** Answer the relative form of the URI against the base, according to the relativeFlags. */ private String relativize( IRI base, String uri ) { // errors? return base.relativize( uri, relativeFlags).toString(); }
/** * The base of this IRIResolver. * @return String */ public String getBaseIRI() { return base.toString(); }
/** Set the error/warning state of a violation code. * @param factory IRIFactory * @param code ViolationCodes constant * @param isError Whether it is to be treated an error. * @param isWarning Whether it is to be treated a warning. */ private static void setErrorWarning(IRIFactory factory, int code, boolean isError, boolean isWarning) { factory.setIsWarning(code, isWarning); factory.setIsError(code, isError); }
/** * Resolves an IRI against this one. * This method is an alias for * {@link IRIFactory#create(String)}. * @see IRIFactory#construct(String) * @param relative IRI to resolve * @return The resolution of relative against this. */ final public IRI resolve(String relative) { return create(relative); } /**
/** * The factory will check for violations of RDF URI Reference. * Note: relative IRIs are prohibited. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationRDF(boolean asErrors){ useSpec("RDF",asErrors); }
static public String abbrevByBase(String uri, String base) { if ( base == null ) return null ; IRI baseIRI = IRIFactory.jenaImplementation().construct(base) ; IRI rel = baseIRI.relativize(uri, relFlags) ; String r = null ; try { r = rel.toASCIIString() ; } catch (MalformedURLException ex) { r = rel.toString() ; } return r ; } }
/** * Validates a URI is indeed valid * @param uri * @return */ public static boolean isValidUri(String uri) { return !iriFactory.create(uri).hasViolation(false); }
Test2(String r) { super( WGTestSuite.this.testDir.relativize(r, IRI.CHILD).toString()); // testID = r; } Model read(String file, boolean type) throws IOException {
/** * The base of this IRIResolver. * @return */ public String getBaseIRI() { return base.toString(); }
/** * Resolves an IRI against this one. * This method is an alias for * {@link IRIFactory#create(IRI)}. * @see IRIFactory#construct(IRI) * @param relative IRI to resolve * @return The resolution of relative against this. */ final public IRI resolve(IRI relative) { return create(relative); }
/** * The factory will check for violations of RFC 3986, URI. * Non-ascii input will result in warnings or errors. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationURI(boolean asErrors){ useSpec("URI",asErrors); } /**
static public String abbrevByBase(String uri, String base) { if ( base == null ) return null ; IRI baseIRI = IRIFactory.jenaImplementation().construct(base) ; IRI rel = baseIRI.relativize(uri, relFlags) ; String r = null ; try { r = rel.toASCIIString() ; } catch (MalformedURLException ex) { r = rel.toString() ; } return r ; }
/** * The factory will check for violations of RFC 3987, IRI. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationIRI(boolean asErrors){ useSpec("IRI",asErrors); }
/** * The factory will check for violations of XLink locator: <code>href</code> value. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationXLink(boolean asErrors){ useSpec("XLink",asErrors); } /**
/** * The factory will check for violations of RFC 3986, URI. * Non-ascii input will result in warnings or errors. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationURI(boolean asErrors){ useSpec("URI",asErrors); } /**
/** * The factory will check for violations of XML Schema anyURI. * @param asErrors If true, then violations are treated as errors; if false violations are treated as warnings. * @throws IllegalStateException If this factory has already been used to create an IRI. */ public void useSpecificationXMLSchema(boolean asErrors){ usingSpecXMLSchema = true; useSpec("Schema",asErrors); }