Class RdfClass
java.lang.Object
org.aksw.jena_sparql_api.mapper.impl.type.RdfTypeBase
org.aksw.jena_sparql_api.mapper.impl.type.RdfTypeComplexBase
org.aksw.jena_sparql_api.mapper.impl.type.RdfClass
- All Implemented Interfaces:
RdfType
An RdfClass is one type of implementation that can map Java objects to and from RDF graphs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConceptThe concept that captures rdf terms that are instances of this class.A function for obtaining a default IRI from an objectprotected org.aksw.commons.beans.model.EntityOpsThe affected class (maybe we should use the fully qualified class name instead?)protected booleanPopulators are used to map between property values and RDF data A single populator may thereby set multiple properties at once.protected Map<String,RdfPropertyDescriptor> PropertyDescriptors map the Java property types to RdfType instances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyDescriptor(RdfPropertyDescriptor propertyDescriptor) voidaddPropertyMapper(RdfMapper populator) voidcreateJavaObject(org.apache.jena.rdf.model.RDFNode r) Extract a Java (literal) object from a given node.createProxy(org.apache.jena.sparql.core.DatasetGraph datasetGraph, org.apache.jena.graph.Node subject) Deprecated.Use createJavaObject first, and initialize values from a datasetGraph using a separate call to one of the methods of this class TODO which method?voidexposeFragment(ResourceFragment out, org.apache.jena.rdf.model.Resource priorState, Object entity) Return an RDF graph from the entity, where nodes may be placeholdersvoidexposeShape(ResourceShapeBuilder builder) Class<?>Return the Java class corresponding to this type (maybe it should be Type instead of Class)org.aksw.commons.beans.model.EntityOpsstatic MethodInterceptorRdfgetPropertyDescriptors(String propertyName) org.apache.jena.graph.NodeReturns the subject of a given object or null if not present.booleanFlag to indicate whether entities created from this mapping have their own identity.booleanWhether this RdfClass instance is fully initialized.Set property values of the given target object based a DatasetGraph.voidsetPopulated(boolean isPopulated) toJava(org.apache.jena.graph.Node node) toString()Methods inherited from class org.aksw.jena_sparql_api.mapper.impl.type.RdfTypeComplexBase
isSimpleType
-
Field Details
-
entityOps
protected org.aksw.commons.beans.model.EntityOps entityOpsThe affected class (maybe we should use the fully qualified class name instead?) -
concept
The concept that captures rdf terms that are instances of this class. In the simplest case this is { ?s | ?s a <http://example.org/ontology/SomeType> } -
defaultIriFn
A function for obtaining a default IRI from an object -
populators
Populators are used to map between property values and RDF data A single populator may thereby set multiple properties at once. However, the value and the RdfType of the property determine whether additional population is needed. A persistenceContext is used to keep track of beans that were not populated yet. Each property has a corresponding RdfType -
propertyDescriptors
PropertyDescriptors map the Java property types to RdfType instances. The population status of a property value depends on the RdfType and value in regard to a persistenceContext. -
isPopulated
protected boolean isPopulated
-
-
Constructor Details
-
RdfClass
-
-
Method Details
-
getPropertyMappers
-
getPropertyDescriptors
-
getPropertyDescriptors
-
getEntityOps
public org.aksw.commons.beans.model.EntityOps getEntityOps() -
getConcept
-
setPopulated
public void setPopulated(boolean isPopulated) -
checkPopulated
public void checkPopulated() -
addPropertyDescriptor
-
addPropertyMapper
-
isPopulated
public boolean isPopulated()Whether this RdfClass instance is fully initialized.- Returns:
-
getEntityClass
Description copied from interface:RdfTypeReturn the Java class corresponding to this type (maybe it should be Type instead of Class)- Returns:
-
exposeShape
-
getMethodInterceptor
-
getRootNode
Returns the subject of a given object or null if not present. First the object is checked for whether it is a proxy referring to a prior subject, which is returned if present. Otherwise, a default iri will be generated.- Parameters:
o-- Returns:
-
toJava
-
populate
Set property values of the given target object based a DatasetGraph.- Parameters:
entity-datasetGraph-
-
createProxy
@Deprecated public Object createProxy(org.apache.jena.sparql.core.DatasetGraph datasetGraph, org.apache.jena.graph.Node subject) Deprecated.Use createJavaObject first, and initialize values from a datasetGraph using a separate call to one of the methods of this class TODO which method?Create a proxied instance of the class based on the given graph- Parameters:
datasetGraph-- Returns:
-
toString
-
createJavaObject
Description copied from interface:RdfTypeExtract a Java (literal) object from a given node. Note: Creating a *non-primitive* java object is not a concern of RdfType which only *MAPS* between a java object and its corresponding triples. The reason is, that via the RdfType's entity class the association to a newInstance method can be indirectly made on the outside, without RdfType having to be aware of it. Also, an RdfType reading a collection may be capable of reading and writing to any collection type, regardless of the concrete sub-type (list, set, etc). Create an empty java object (i.e. no properties set) based on the given node. In the case of primitive types (e.g. String, Long, etc), the object will already carry the correct value. In the case of classes, the result may either be a Java object regardless of the node argument, or a proxy to such java object that holds the node- Returns:
-
hasIdentity
public boolean hasIdentity()Description copied from interface:RdfTypeFlag to indicate whether entities created from this mapping have their own identity. If not, ids are usually derived from the parent object- Returns:
-
exposeFragment
public void exposeFragment(ResourceFragment out, org.apache.jena.rdf.model.Resource priorState, Object entity) Return an RDF graph from the entity, where nodes may be placeholders- Parameters:
entity-
-
resolve
- Specified by:
resolvein interfaceRdfType- Overrides:
resolvein classRdfTypeBase
-