|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface for objects that are capable of creating a Protege resource name from an URI. This is used in the Jena2Protege to convert (Jena) resource URIs into names for the corresponding Protege objects.
The use pattern of the Jena2Protege class is to first see if it can resolve a URI with the current namespace prefix definitions. For example, if a URI "http://www.w3.org/2002/07/owl#Class" is referenced, then the system can resolve this to "owl:Class", because "owl" is a defined prefix for that namespace. However, during loading, a URI may be a forward reference to a namespace which is prefixed in some other imported file, e.g. "http://aldi.de/products.owl#Apple" where the name "aldi:Apple" cannot be created yet because the corresponding namespace declaration hasn't been reached yet, or doesn't exist at all. In the latter case, the system will later create a default prefix, such as "p1". In the normal case though, the prefix will be reached later. Anyway, the resource needs to still have a name so that it can be looked up successfully in future references. So, if no default name could be resolved, the system will use a temporary name (e.g. the whole URI) and later replace the temp name with the "real" resource name. This interface also allows to create names for anonymous resources.
Method Summary | |
String |
addPrefix(String uri,
String prefix)
Adds a new prefix-namespace pair to this converter. |
String |
createAnonymousRDFResourceName()
|
String |
createNewPrefix(String uri)
Creates a dummy prefix and adds it to the OWLModel |
String |
getRDFExternalResourceName()
|
String |
getRDFResourceName(String uri)
Gets the Protege resource name for a given URI. |
String |
getResourceNamespace(String uri)
Gets the namespace part of a resource URI. |
String |
getTemporaryRDFResourceName(com.hp.hpl.jena.rdf.arp.AResource node)
|
String |
getTemporaryRDFResourceName(String uri)
|
String |
getURIFromTemporaryName(String temporaryName)
The inverse of getTemporaryRDFResourceName() . |
boolean |
isAnonymousRDFResourceName(String name)
Checks whether a given name describes an anonymous resource. |
boolean |
isTemporaryRDFResourceName(String name)
Checks if this is a name that was created as a temporary name before. |
void |
updateInternalState()
Called after the triples have been copied and new namespace prefixes assigned. |
Method Detail |
public String addPrefix(String uri, String prefix)
uri
- the URI/namespaceprefix
- the new prefix
public String createNewPrefix(String uri)
uri
- the URI of the resource to create a new prefix forpublic String createAnonymousRDFResourceName()
public String getResourceNamespace(String uri)
uri
- the URI to get the namespace of
public String getRDFExternalResourceName()
public String getRDFResourceName(String uri)
uri
- the URI to get the name of
public String getTemporaryRDFResourceName(String uri)
public String getTemporaryRDFResourceName(com.hp.hpl.jena.rdf.arp.AResource node)
public String getURIFromTemporaryName(String temporaryName)
getTemporaryRDFResourceName()
.
temporaryName
- the temporary name
public boolean isAnonymousRDFResourceName(String name)
name
- the name of the resource to test
public boolean isTemporaryRDFResourceName(String name)
name
- the name to test
public void updateInternalState()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |