public class StandardShortnameService extends Object implements ShortnameService
ShortnameService.Util
Modifier and Type | Field and Description |
---|---|
protected Context |
context |
protected Set<String> |
datatypes |
protected static com.hp.hpl.jena.rdf.model.Model |
emptyModel |
protected com.hp.hpl.jena.shared.PrefixMapping |
prefixes |
protected static String |
rdf_XMLLiteral |
protected static com.hp.hpl.jena.rdf.model.Resource |
rootResource |
Constructor and Description |
---|
StandardShortnameService() |
StandardShortnameService(com.hp.hpl.jena.rdf.model.Model config) |
StandardShortnameService(com.hp.hpl.jena.rdf.model.Resource specRoot,
com.hp.hpl.jena.shared.PrefixMapping prefixes,
ModelLoader loader)
Initialise a ShortnameService
|
Modifier and Type | Method and Description |
---|---|
Context |
asContext()
Return a Context object suitable for driving the JSON encoding
|
com.hp.hpl.jena.rdf.model.Resource |
asResource(com.hp.hpl.jena.rdf.model.RDFNode res)
Convert a resource specification to a resource.
|
com.hp.hpl.jena.rdf.model.Resource |
asResource(String res)
Answer a resource with uri = expand(s).
|
Map<String,String> |
constructURItoShortnameMap(com.hp.hpl.jena.rdf.model.Model m,
com.hp.hpl.jena.shared.PrefixMapping pm)
Answer a freshly-constructed map from URIs to shortnames, based on
the shortnames declared to this ShortnameService.
|
Map<String,String> |
copyWithout(Map<String,String> baseMap,
Map<String,String> toRemove) |
void |
declareDatatype(String type) |
String |
expand(String shortName)
Find the full URI for the given short name, or null if we can't
find one.
|
com.hp.hpl.jena.shared.PrefixMapping |
getPrefixes()
Get the prefix/URI mapping defined for this API
|
ContextPropertyInfo |
getPropertyByName(String shortName)
Answer the property info record for the property with this shortname.
|
boolean |
isDatatype(String type)
Answer true iff the named type has been declared (or is by default)
to be a datatype (rather than an object type).
|
void |
loadVocabulary(com.hp.hpl.jena.rdf.model.Model vocab,
Set<String> seen,
com.hp.hpl.jena.shared.PrefixMapping prefixes,
com.hp.hpl.jena.shared.PrefixMapping pm) |
protected final Context context
protected final com.hp.hpl.jena.shared.PrefixMapping prefixes
protected static final com.hp.hpl.jena.rdf.model.Model emptyModel
protected static final com.hp.hpl.jena.rdf.model.Resource rootResource
protected static final String rdf_XMLLiteral
public StandardShortnameService(com.hp.hpl.jena.rdf.model.Resource specRoot, com.hp.hpl.jena.shared.PrefixMapping prefixes, ModelLoader loader)
specRoot
- the API specificationprefixes
- prefixes to useloader
- the loader to use for vocabulariespublic StandardShortnameService()
public StandardShortnameService(com.hp.hpl.jena.rdf.model.Model config)
public void loadVocabulary(com.hp.hpl.jena.rdf.model.Model vocab, Set<String> seen, com.hp.hpl.jena.shared.PrefixMapping prefixes, com.hp.hpl.jena.shared.PrefixMapping pm)
public com.hp.hpl.jena.shared.PrefixMapping getPrefixes()
getPrefixes
in interface ShortnameService
public String expand(String shortName)
expand
in interface ShortnameService
public com.hp.hpl.jena.rdf.model.Resource asResource(com.hp.hpl.jena.rdf.model.RDFNode res)
asResource
in interface ShortnameService
public com.hp.hpl.jena.rdf.model.Resource asResource(String res)
ShortnameService
asResource
in interface ShortnameService
public Context asContext()
asContext
in interface ShortnameService
public void declareDatatype(String type)
public boolean isDatatype(String type)
ShortnameService
isDatatype
in interface ShortnameService
public Map<String,String> constructURItoShortnameMap(com.hp.hpl.jena.rdf.model.Model m, com.hp.hpl.jena.shared.PrefixMapping pm)
ShortnameService
constructURItoShortnameMap
in interface ShortnameService
public Map<String,String> copyWithout(Map<String,String> baseMap, Map<String,String> toRemove)
public ContextPropertyInfo getPropertyByName(String shortName)
ShortnameService
getPropertyByName
in interface ShortnameService
Copyright © 2014. All Rights Reserved.