java.lang.Object
org.apache.jena.sparql.util.graph.GraphUtils
Graph utilities. See also GraphFactory.
-
Constructor Summary
-
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 boolean
atmostOneProperty
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static boolean
exactlyOneProperty
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static org.apache.jena.rdf.model.Resource
findRootByType
(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 String
fmtURI
(org.apache.jena.rdf.model.Resource r) 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.static org.apache.jena.rdf.model.RDFNode
getAsRDFNode
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) 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.static boolean
getBooleanValue
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static org.apache.jena.rdf.model.Resource
getResourceByType
(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource type) static org.apache.jena.rdf.model.Resource
getResourceValue
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) static String
getStringValue
(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Get a string literal.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.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 -
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. -
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
public static boolean exactlyOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
atmostOneProperty
public static boolean atmostOneProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) -
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.
-