public class ModelUtilities extends Object
Constructor and Description |
---|
ModelUtilities() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkExistingResource(RDFModel model,
ARTResource res)
Deprecated.
use {@link RDFModel#existsResource(ARTResource, ARTResource...) instead
|
static Collection<ARTStatement> |
createCBD(RDFModel model,
ARTResource resource,
boolean inferred,
ARTResource... graphs)
creates the Concise Bounded Description for an RDF
Resource
|
static Collection<ARTStatement> |
createCustomCBD(RDFModel model,
ARTResource resource,
boolean inferred,
PropertyChainsTree propChainTree,
ARTResource... graphs)
creates a customized Concise Bounded Description for an
RDF Resource, where the statements are expanded either according to the original constraint (i.e. the
objects of triples are bnodes) or because the predicate matches a particular property chain
|
static String |
createDefaultNamespaceFromBaseURI(String baseuri)
given the baseuri of an ontology, returns the baseuri
|
static void |
deepDeleteIndividual(ARTResource resource,
RDFModel model,
PropertyChainsTree delPropTree,
ARTResource... graphs)
this method helps in deleting individuals and their associated info. the PropertyChainsTree is used to
distinguish which linked nodes in the graph should be deleted together with the main individual
If an individual reachable through the property chain is however referred (it is object of a triple) by other individuals, then it is not deleted |
static int |
getNumberOfClassInstances(DirectReasoning model,
ARTResource cls,
boolean direct,
ARTResource... graphs)
returns the number of resources which are direct instances of
cls |
static RDFResourceRolesEnum |
getPropertyRole(ARTURIResource property,
RDFModel ontModel) |
static RDFResourceRolesEnum |
getResourceRole(ARTResource resource,
RDFModel ontModel)
this gets the ontType of the resource taken from the
RDFTypesEnum enumerated class. |
static String |
guessPrefix(String namespace)
given namespace
namespace , this tries to automatically suggest a prefix for it |
static boolean |
isAvailableNamespace(RDFModel om,
String ns)
this method tells if namespace
ns is present among the list of namespaces in model
om |
public static boolean isAvailableNamespace(RDFModel om, String ns) throws ModelAccessException
ns
is present among the list of namespaces in model
om
rep
- ns
- ModelAccessException
public static String guessPrefix(String namespace)
namespace
, this tries to automatically suggest a prefix for itnamespace
- public static String createDefaultNamespaceFromBaseURI(String baseuri)
baseuri
- public static void deepDeleteIndividual(ARTResource resource, RDFModel model, PropertyChainsTree delPropTree, ARTResource... graphs) throws ModelUpdateException
resource
- model
- ModelUpdateException
public static Collection<ARTStatement> createCBD(RDFModel model, ARTResource resource, boolean inferred, ARTResource... graphs) throws ModelAccessException
model
- resource
- inferred
- graphs
- ModelAccessException
http://www.w3.org/Submission/CBD/}
public static Collection<ARTStatement> createCustomCBD(RDFModel model, ARTResource resource, boolean inferred, PropertyChainsTree propChainTree, ARTResource... graphs) throws ModelAccessException
model
- resource
- inferred
- propChainTree
- graphs
- ModelAccessException
public static int getNumberOfClassInstances(DirectReasoning model, ARTResource cls, boolean direct, ARTResource... graphs) throws ModelAccessException
cls
model
- cls
- ModelAccessException
public static boolean checkExistingResource(RDFModel model, ARTResource res) throws ModelAccessException
res
RDFModel.retrieveURIResource(String, ARTResource...)
and
RDFModel.existsResource(ARTResource, ARTResource...)
model
- res
- ModelAccessException
public static RDFResourceRolesEnum getResourceRole(ARTResource resource, RDFModel ontModel) throws ModelAccessException
RDFTypesEnum
enumerated class.resource
- ontModel
- ModelAccessException
public static RDFResourceRolesEnum getPropertyRole(ARTURIResource property, RDFModel ontModel) throws ModelAccessException
ModelAccessException
Copyright © 2015 ART Group, University of Rome, Tor Vergata. All Rights Reserved.