org.openjena.riot.system
Class IRIResolver

java.lang.Object
  extended by org.openjena.riot.system.IRIResolver

public abstract class IRIResolver
extends Object

Package up IRI reolver functionality.


Field Summary
static com.hp.hpl.jena.iri.IRIFactory iriFactory
          The IRI checker setup - more than usual Jena but not full IRI.
 
Method Summary
static boolean checkIRI(String iriStr)
          Check an IRI string (does not resolve it)
static com.hp.hpl.jena.iri.IRI chooseBaseURI()
          Choose a base URI based on the current directory
static com.hp.hpl.jena.iri.IRI chooseBaseURI(String baseURI)
          Deprecated. 
static IRIResolver create()
           
static IRIResolver create(com.hp.hpl.jena.iri.IRI baseIRI)
           
static IRIResolver create(String baseStr)
           
static IRIResolver createNoResolve()
           
 String getBaseIRIasString()
           
static com.hp.hpl.jena.iri.IRI parseIRI(String iriStr)
          Parse an IRI (does not resolve it)
abstract  com.hp.hpl.jena.iri.IRI resolve(String uriStr)
          Create a URI, resolving relative IRIs, and throw exception on bad a IRI
static com.hp.hpl.jena.iri.IRI resolve(String relStr, String baseStr)
          Create resolve a URI against a base.
static String resolveFileURL(String filename)
          Turn a filename into a well-formed file: URL relative to the working directory.
static com.hp.hpl.jena.iri.IRI resolveIRI(String uriStr)
          Resolve an IRI against whatever is the base for this process (likely to be based on the current working directory of this process at the time of initialization of this class).
abstract  com.hp.hpl.jena.iri.IRI resolveSilent(String uriStr)
          Create a URI, resolving relative IRIs, but do not throw exception on bad a IRI
static String resolveString(String relStr, String baseStr)
          Create resolve a URI against a base.
 String resolveToString(String uriStr)
          Resolving relative IRIs, return a string
 String resolveToStringSilent(String uriStr)
          Resolving relative IRIs, return a string, but do not throw exception on bad a IRI
static void suppressExceptions()
          To allow Eyeball to bypass IRI checking (because it's doing its own)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iriFactory

public static final com.hp.hpl.jena.iri.IRIFactory iriFactory
The IRI checker setup - more than usual Jena but not full IRI.

Method Detail

checkIRI

public static boolean checkIRI(String iriStr)
Check an IRI string (does not resolve it)


parseIRI

public static com.hp.hpl.jena.iri.IRI parseIRI(String iriStr)
Parse an IRI (does not resolve it)


resolveFileURL

public static String resolveFileURL(String filename)
                             throws com.hp.hpl.jena.iri.IRIException
Turn a filename into a well-formed file: URL relative to the working directory.

Parameters:
filename -
Returns:
String The filename as an absolute URL
Throws:
com.hp.hpl.jena.iri.IRIException

resolve

public static com.hp.hpl.jena.iri.IRI resolve(String relStr,
                                              String baseStr)
                                       throws RiotException
Create resolve a URI against a base. If baseStr is a relative file IRI then it is first resolved against the current working directory.

Parameters:
relStr -
baseStr - Can be null if relStr is absolute
Returns:
An absolute URI
Throws:
RiotException - If result would not be legal, absolute IRI

resolveString

public static String resolveString(String relStr,
                                   String baseStr)
                            throws RiotException
Create resolve a URI against a base. If baseStr is a relative file IRI then it is first resolved against the current working directory.

Parameters:
relStr -
baseStr - Can be null if relStr is absolute
Returns:
String An absolute URI
Throws:
RiotException - If result would not be legal, absolute IRI

resolveIRI

public static com.hp.hpl.jena.iri.IRI resolveIRI(String uriStr)
Resolve an IRI against whatever is the base for this process (likely to be based on the current working directory of this process at the time of initialization of this class).


create

public static IRIResolver create()

create

public static IRIResolver create(String baseStr)

create

public static IRIResolver create(com.hp.hpl.jena.iri.IRI baseIRI)

createNoResolve

public static IRIResolver createNoResolve()

suppressExceptions

public static void suppressExceptions()
To allow Eyeball to bypass IRI checking (because it's doing its own)


chooseBaseURI

public static com.hp.hpl.jena.iri.IRI chooseBaseURI()
Choose a base URI based on the current directory

Returns:
String Absolute URI

chooseBaseURI

@Deprecated
public static com.hp.hpl.jena.iri.IRI chooseBaseURI(String baseURI)
Deprecated. 

Choose a baseURI based on a suggestion

Returns:
IRI (if relative, relative to current working directory).

getBaseIRIasString

public String getBaseIRIasString()

resolve

public abstract com.hp.hpl.jena.iri.IRI resolve(String uriStr)
Create a URI, resolving relative IRIs, and throw exception on bad a IRI


resolveSilent

public abstract com.hp.hpl.jena.iri.IRI resolveSilent(String uriStr)
Create a URI, resolving relative IRIs, but do not throw exception on bad a IRI


resolveToString

public String resolveToString(String uriStr)
Resolving relative IRIs, return a string


resolveToStringSilent

public String resolveToStringSilent(String uriStr)
Resolving relative IRIs, return a string, but do not throw exception on bad a IRI



Licenced under the Apache License, Version 2.0