java.lang.Object
org.apache.jena.sparql.util.graph.GraphUtils
Graph utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Iterator<org.apache.jena.graph.Node> allNodes(org.apache.jena.graph.Graph graph) All subjects and objects, no duplicates.static booleanatmostOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Deprecated, for removal: This API element is subject to removal in a future version.static booleanatMostOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Check whether the resource-property pair has zero or one values.static booleancheckExactlyOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Returns for exactly one object of a subject-property, else return false.static booleanexactlyOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Deprecated, for removal: This API element is subject to removal in a future version.static voidexactlyOnePropertyEx(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Check for exactly one object of a subject-property.static org.apache.jena.rdf.model.ResourcefindRootByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource atype) static List<org.apache.jena.rdf.model.Resource> findRootsByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource atype) static StringfmtURI(org.apache.jena.rdf.model.Resource r) static StringgetAsFilename(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string for a filename, either a string (filename as-=is) or a "file:" URI, translated to a filename.static org.apache.jena.rdf.model.RDFNodegetAsRDFNode(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static StringgetAsStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string literal or a URI as a string.static booleangetBooleanValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static org.apache.jena.rdf.model.ResourcegetResourceByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource type) static org.apache.jena.rdf.model.ResourcegetResourceValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static StringgetStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string literal.static StringgetStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, org.apache.jena.datatypes.RDFDatatype datatype) Get the string (lexical form) of a literal with a check that the datatype is as expected.static List<org.apache.jena.rdf.model.Resource> listResourcesByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource type) static List<org.apache.jena.rdf.model.RDFNode> multiValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) multiValueAsFilename(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a list of the string and URIs treating each as a filenames, that is strings and file: URIs converted to filenames.multiValueAsString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a list of the URIs (as strings) and stringsstatic List<org.apache.jena.rdf.model.Resource> multiValueResource(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) multiValueString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get all the literals for a resource-property.multiValueURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p)
-
Constructor Details
-
GraphUtils
public GraphUtils()
-
-
Method Details
-
multiValueString
public static List<String> multiValueString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get all the literals for a resource-property. -
multiValueAsString
public static List<String> multiValueAsString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a list of the URIs (as strings) and strings- See Also:
-
multiValueAsFilename
public static List<String> multiValueAsFilename(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a list of the string and URIs treating each as a filenames, that is strings and file: URIs converted to filenames.- See Also:
-
multiValue
public static List<org.apache.jena.rdf.model.RDFNode> multiValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
multiValueResource
public static List<org.apache.jena.rdf.model.Resource> multiValueResource(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
multiValueURI
-
exactlyOneProperty
@Deprecated(forRemoval=true) public static boolean exactlyOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Deprecated, for removal: This API element is subject to removal in a future version. -
checkExactlyOneProperty
public static boolean checkExactlyOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Returns for exactly one object of a subject-property, else return false. -
exactlyOnePropertyEx
public static void exactlyOnePropertyEx(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Check for exactly one object of a subject-property. Throw an exception is this condition is not correct. -
atmostOneProperty
@Deprecated(forRemoval=true) public static boolean atmostOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Deprecated, for removal: This API element is subject to removal in a future version.UseatMostOneProperty(org.apache.jena.rdf.model.Resource, org.apache.jena.rdf.model.Property)which always returns a boolean and does not throw exceptions. -
atMostOneProperty
public static boolean atMostOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Check whether the resource-property pair has zero or one values. Return true or false. -
getBooleanValue
public static boolean getBooleanValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
getStringValue
public static String getStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string literal. -
getStringValue
public static String getStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, org.apache.jena.datatypes.RDFDatatype datatype) Get the string (lexical form) of a literal with a check that the datatype is as expected. -
getAsStringValue
public static String getAsStringValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string literal or a URI as a string. -
getAsFilename
public static String getAsFilename(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string for a filename, either a string (filename as-=is) or a "file:" URI, translated to a filename. Otherwise throw an exception. -
getAsRDFNode
public static org.apache.jena.rdf.model.RDFNode getAsRDFNode(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
getResourceValue
public static org.apache.jena.rdf.model.Resource getResourceValue(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
listResourcesByType
public static List<org.apache.jena.rdf.model.Resource> listResourcesByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource type) -
getResourceByType
public static org.apache.jena.rdf.model.Resource getResourceByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource type) -
findRootByType
public static org.apache.jena.rdf.model.Resource findRootByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource atype) -
findRootsByType
public static List<org.apache.jena.rdf.model.Resource> findRootsByType(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource atype) -
fmtURI
-
allNodes
All subjects and objects, no duplicates.
-
atMostOneProperty(org.apache.jena.rdf.model.Resource, org.apache.jena.rdf.model.Property)which always returns a boolean and does not throw exceptions.