Package se.liu.ida.hefquin.jenaext
Class ModelUtils
java.lang.Object
se.liu.ida.hefquin.jenaext.ModelUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static org.apache.jena.rdf.model.LiteralgetSingleLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) static org.apache.jena.rdf.model.LiteralgetSingleMandatoryLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is a literal.static org.apache.jena.rdf.model.RDFNodegetSingleMandatoryProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Based on the assumption that the given resource has a single value for the given property, this function returns this.static StringgetSingleMandatoryProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is an xsd:string literal.static URIgetSingleMandatoryProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is an xsd:anyURI literal.static org.apache.jena.rdf.model.ResourcegetSingleMandatoryResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is a resource (not a literal).static org.apache.jena.rdf.model.LiteralgetSingleOptionalLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is a literal.static org.apache.jena.rdf.model.RDFNodegetSingleOptionalProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Based on the assumption that the given resource may have a single value for the given property, this function returns either this value or null, depending on whether the resource has such a value.static StringgetSingleOptionalProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is an xsd:string literal.static URIgetSingleOptionalProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is an xsd:anyURI literal.static org.apache.jena.rdf.model.ResourcegetSingleOptionalResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is a resource (not a literal).protected static org.apache.jena.rdf.model.RDFNodegetSingleProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) protected static StringgetSingleProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) protected static URIgetSingleProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) protected static org.apache.jena.rdf.model.ResourcegetSingleResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory)
-
Constructor Details
-
ModelUtils
public ModelUtils()
-
-
Method Details
-
getSingleOptionalProperty
public static org.apache.jena.rdf.model.RDFNode getSingleOptionalProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Based on the assumption that the given resource may have a single value for the given property, this function returns either this value or null, depending on whether the resource has such a value. If the resource has multiple values for the property, anIllegalArgumentExceptionis thrown. -
getSingleOptionalResourceProperty
public static org.apache.jena.rdf.model.Resource getSingleOptionalResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is a resource (not a literal). Based on this assumption, this function returns either the literal or null, depending on whether the resource has such a value. If the value is not a resource or the resource has multiple values for the property, anIllegalArgumentExceptionis thrown. -
getSingleOptionalLiteralProperty
public static org.apache.jena.rdf.model.Literal getSingleOptionalLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is a literal. Based on this assumption, this function returns either the literal or null, depending on whether the resource has such a value. If the value is not a literal or the resource has multiple values for the property, anIllegalArgumentExceptionis thrown. -
getSingleOptionalProperty_XSDString
public static String getSingleOptionalProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is an xsd:string literal. Based on this assumption, this function returns either the string of this literal or null, depending on whether the resource has such a value. If the value is not an xsd:string literal or the resource has multiple values for the property, anIllegalArgumentExceptionis thrown. -
getSingleOptionalProperty_XSDURI
public static URI getSingleOptionalProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource may have a single value for the given property and, if so, this value is an xsd:anyURI literal. Based on this assumption, this function returns either the URI of this literal or null, depending on whether the resource has such a value. If the value is not an xsd:anyURI literal, the lexical form of the literal cannot be converted into a URI, or the resource has multiple values for the property, anIllegalArgumentExceptionis thrown. -
getSingleMandatoryProperty
public static org.apache.jena.rdf.model.RDFNode getSingleMandatoryProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Based on the assumption that the given resource has a single value for the given property, this function returns this. AnIllegalArgumentExceptionis thrown if the resource does not have any value for the property or it has multiple values for the property. -
getSingleMandatoryResourceProperty
public static org.apache.jena.rdf.model.Resource getSingleMandatoryResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is a resource (not a literal). Based on this assumption, this function returns this literal. AnIllegalArgumentExceptionis thrown if the value is not a resource, the resource does not have any value for the property, or it has multiple values for the property. -
getSingleMandatoryLiteralProperty
public static org.apache.jena.rdf.model.Literal getSingleMandatoryLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is a literal. Based on this assumption, this function returns this literal. AnIllegalArgumentExceptionis thrown if the value is not a literal, the resource does not have any value for the property, or it has multiple values for the property. -
getSingleMandatoryProperty_XSDString
public static String getSingleMandatoryProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is an xsd:string literal. Based on this assumption, this function returns the string of this literal. AnIllegalArgumentExceptionis thrown if the value is not an xsd:string literal, the resource does not have any value for the property, or it has multiple values for the property. -
getSingleMandatoryProperty_XSDURI
public static URI getSingleMandatoryProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p) Assumes that the given resource has a single value for the given property and this value is an xsd:anyURI literal. Based on this assumption, this function returns the URI of this literal. AnIllegalArgumentExceptionis thrown if the value is not an xsd:anyURI literal, the lexical form of the literal cannot be converted into a URI, the resource does not have any value for the property, or it has multiple values for the property. -
getSingleProperty
protected static org.apache.jena.rdf.model.RDFNode getSingleProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) -
getSingleResourceProperty
protected static org.apache.jena.rdf.model.Resource getSingleResourceProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) -
getSingleLiteralProperty
protected static org.apache.jena.rdf.model.Literal getSingleLiteralProperty(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) -
getSingleProperty_XSDString
protected static String getSingleProperty_XSDString(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory) -
getSingleProperty_XSDURI
protected static URI getSingleProperty_XSDURI(org.apache.jena.rdf.model.Resource r, org.apache.jena.rdf.model.Property p, boolean mandatory)
-