Skip to content

Commit f25718b

Browse files
committed
More work on Intellisense
1 parent 378f806 commit f25718b

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

OWLSharp/Ontology/Axioms/DataPropertyAxioms/OWLDataPropertyDomain.cs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ namespace OWLSharp.Ontology
2929
public sealed class OWLDataPropertyDomain : OWLDataPropertyAxiom
3030
{
3131
#region Properties
32+
/// <summary>
33+
/// Represents the property used for this data axiom (e.g: http://example.org/hasAge)
34+
/// </summary>
3235
[XmlElement(Order=2)]
3336
public OWLDataProperty DataProperty { get; set; }
3437

35-
//Register here all derived types of OWLClassExpression
38+
/// <summary>
39+
/// Represents the class expression asserted to be domain of the data property (e.g: http://example.org/Person)
40+
/// </summary>
3641
[XmlElement(typeof(OWLClass), ElementName="Class", Order=3)]
3742
[XmlElement(typeof(OWLObjectIntersectionOf), ElementName="ObjectIntersectionOf", Order=3)]
3843
[XmlElement(typeof(OWLObjectUnionOf), ElementName="ObjectUnionOf", Order=3)]
@@ -55,22 +60,29 @@ public sealed class OWLDataPropertyDomain : OWLDataPropertyAxiom
5560
#endregion
5661

5762
#region Ctors
58-
internal OWLDataPropertyDomain()
59-
{ }
63+
internal OWLDataPropertyDomain() { }
64+
65+
/// <summary>
66+
/// Builds an OWLDataPropertyDomain with the given data property and given class expression as domain
67+
/// </summary>
68+
/// <exception cref="OWLException"></exception>
6069
public OWLDataPropertyDomain(OWLDataProperty dataProperty, OWLClassExpression classExpression) : this()
6170
{
62-
DataProperty = dataProperty ?? throw new OWLException("Cannot create OWLDataPropertyDomain because given \"dataProperty\" parameter is null");
63-
ClassExpression = classExpression ?? throw new OWLException("Cannot create OWLDataPropertyDomain because given \"classExpression\" parameter is null");
71+
DataProperty = dataProperty ?? throw new OWLException($"Cannot create OWLDataPropertyDomain because given '{nameof(dataProperty)}' parameter is null");
72+
ClassExpression = classExpression ?? throw new OWLException($"Cannot create OWLDataPropertyDomain because given '{nameof(classExpression)}' parameter is null");
6473
}
6574
#endregion
6675

6776
#region Methods
77+
/// <summary>
78+
/// Exports this OWLDataPropertyDomain to an equivalent RDFGraph object
79+
/// </summary>
6880
public override RDFGraph ToRDFGraph()
6981
{
70-
RDFGraph graph = new RDFGraph();
82+
RDFGraph graph = DataProperty.ToRDFGraph();
83+
7184
RDFResource clsExpressionIRI = ClassExpression.GetIRI();
72-
graph = graph.UnionWith(DataProperty.ToRDFGraph())
73-
.UnionWith(ClassExpression.ToRDFGraph(clsExpressionIRI));
85+
graph = graph.UnionWith(ClassExpression.ToRDFGraph(clsExpressionIRI));
7486

7587
//Axiom Triple
7688
RDFTriple axiomTriple = new RDFTriple(DataProperty.GetIRI(), RDFVocabulary.RDFS.DOMAIN, clsExpressionIRI);

0 commit comments

Comments
 (0)