Package org.semanticweb.owlapi.io
Class RDFResourceBlankNode
java.lang.Object
org.semanticweb.owlapi.io.RDFNode
org.semanticweb.owlapi.io.RDFResource
org.semanticweb.owlapi.io.RDFResourceBlankNode
- All Implemented Interfaces:
Serializable
,Comparable<RDFNode>
,org.apache.commons.rdf.api.BlankNode
,org.apache.commons.rdf.api.BlankNodeOrIRI
,org.apache.commons.rdf.api.RDFTerm
,HasIRI
public class RDFResourceBlankNode
extends RDFResource
implements org.apache.commons.rdf.api.BlankNode
Anonymous node implementation.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRDFResourceBlankNode
(boolean isIndividual, boolean forceId, boolean isAxiom) Create an RDFResource that is anonymousRDFResourceBlankNode
(Integer anonId, boolean isIndividual, boolean forceId, boolean isAxiom) Create an RDFResource that is anonymous.RDFResourceBlankNode
(IRI resource, boolean isIndividual, boolean forceId, boolean isAxiom) Create an RDFResource that is anonymous. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getIRI()
Gets the IRI of this object.For blank nodes, return a valid value for the RDF/XML nodeId attribute.int
hashCode()
boolean
Determines if this node is a resource and is anonymous.boolean
isAxiom()
Determines if this node is an axiom.boolean
boolean
Determines if this node is a literal node.void
setIdRequired
(boolean b) boolean
toString()
Methods inherited from class org.semanticweb.owlapi.io.RDFResource
compareTo, ntriplesString
Methods inherited from class org.semanticweb.owlapi.io.RDFNode
idRequired
Methods inherited from interface org.apache.commons.rdf.api.RDFTerm
ntriplesString
-
Constructor Details
-
RDFResourceBlankNode
Create an RDFResource that is anonymous.- Parameters:
resource
- The IRI of the resourceisIndividual
- true if the node represents an individualforceId
- true if id should be outputisAxiom
- true if axiom
-
RDFResourceBlankNode
Create an RDFResource that is anonymous.- Parameters:
anonId
- the number at the end of the anon IRIisIndividual
- true if the node represents an individualforceId
- true if id should be outputisAxiom
- true if axiom
-
RDFResourceBlankNode
public RDFResourceBlankNode(boolean isIndividual, boolean forceId, boolean isAxiom) Create an RDFResource that is anonymous- Parameters:
isIndividual
- true if this is an individualforceId
- true if the id should be outputisAxiom
- true if axiom
-
-
Method Details
-
isIndividual
public boolean isIndividual()- Overrides:
isIndividual
in classRDFNode
- Returns:
- true if this is an anonymous individual
-
isAxiom
public boolean isAxiom()Description copied from class:RDFNode
Determines if this node is an axiom. -
shouldOutputId
public boolean shouldOutputId()- Overrides:
shouldOutputId
in classRDFNode
- Returns:
- true if blank node id is mandatory for this resource
-
setIdRequired
public void setIdRequired(boolean b) - Parameters:
b
- change the value of the id required flag
-
isLiteral
public boolean isLiteral()Description copied from class:RDFNode
Determines if this node is a literal node. -
isAnonymous
public boolean isAnonymous()Description copied from class:RDFNode
Determines if this node is a resource and is anonymous.- Overrides:
isAnonymous
in classRDFNode
- Returns:
true
if this is a resource node (i.e.RDFNode.isLiteral()
returnsfalse
) and the node is anonymous, orfalse
if this is a resource node and is not anonymous.
-
hashCode
public int hashCode() -
equals
-
toString
-
getIRI
Description copied from interface:HasIRI
Gets the IRI of this object. -
getResource
- Specified by:
getResource
in classRDFResource
- Returns:
- the resource IRI
-
uniqueReference
- Specified by:
uniqueReference
in interfaceorg.apache.commons.rdf.api.BlankNode
-
getNodeIDValue
Description copied from class:RDFResource
For blank nodes, return a valid value for the RDF/XML nodeId attribute. For non blank nodes, an exception should be thrown. The method must only be called on blank nodes.- Specified by:
getNodeIDValue
in classRDFResource
- Returns:
- a valid value for thE RDF/XML nodeId attribute
-