Package cz.vutbr.fit.layout.api
Interface IRIDecoder
-
- All Known Implementing Classes:
DefaultIRIDecoder
public interface IRIDecoderAn IRI encoder / decoder. It maintains a set of prexifes and allows converting an IRI to its prefixed form and back to full form.- Author:
- burgetr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringdeclarePrefixes()Generates a prefix declaration string (e.g. for SPARQL) containing the currenly known prefixes.org.eclipse.rdf4j.model.IRIdecodeIri(String shortIri)Converts a prefixed string to an IRI.StringencodeIri(org.eclipse.rdf4j.model.IRI iri)Converts an IRI to its prefixed string.Map<String,String>getPrefixUris()Gets a map that assigns uris to known prefix names.
-
-
-
Method Detail
-
encodeIri
String encodeIri(org.eclipse.rdf4j.model.IRI iri)
Converts an IRI to its prefixed string.- Parameters:
iri- the IRI to encode- Returns:
- the prefixed IRI string
-
decodeIri
org.eclipse.rdf4j.model.IRI decodeIri(String shortIri) throws IllegalArgumentException
Converts a prefixed string to an IRI.- Parameters:
shortIri- the prefixed IRI string.- Returns:
- the decoded IRI
- Throws:
IllegalArgumentException- when the given IRI could not be decoded (has an invalid format)
-
getPrefixUris
Map<String,String> getPrefixUris()
Gets a map that assigns uris to known prefix names.- Returns:
- the map prefix name to URI prefix
-
declarePrefixes
String declarePrefixes()
Generates a prefix declaration string (e.g. for SPARQL) containing the currenly known prefixes.- Returns:
- the prefix declaration string
-
-