0

Request for assistance denoting a domain-restriction to a blank node. Modelling a Many-to-Many (Relational) Table with a Blank Node Figure 1: Modelling a many-to-many relationship with a blank node.

Business Rule: An Enrolment maps one Student to one Section, once.

My attempt:

∃hasStudent.⊤ ≡ ∃hasSection.⊤ ≡ ∃grade_code.⊤ 

i.e. "the set of individuals that have some value for the role 'hasStudent' is the same set of individuals that have some value for the role 'hasSection' ...e.t.c."

I assume equivalence here instead of inclusion since the inclusions would be in both directions.

Restricting further:

∃hasStudent.⊤ ≡ ∃hasSection.⊤ ≡ ∃grade_code.⊤ ≡ =1hasStudent.⊤ ≡ =1hasSection.⊤ ≡ =1grade_code.⊤

i.e. "the set of individuals that have values for the roles 'hasStudent', 'hasSection' and 'grade_code', have one and only one value for them."

Assistance or comments on correctly denoting the domain-restrictions of the object properties in figure 1 would be appreciated.

Thanks!!

JohnG79
  • 1,485
  • 1
  • 17
  • 23

2 Answers2

2

OWL's Open World assumption is going to prevent you from finding "the set of individuals that have values for the roles 'hasStudent', 'hasSection' and 'grade_code', have one and only one value for them."

However, using SPARQL, you could create an ASK query that does just what you are asking for:

ASK {
   SELECT (count(?student) AS ?stcount) (count(?section) AS ?secount) (count(?course) AS ?ccount)
   WHERE {
      ?indiv :hasStudent ?student .
      ?indiv :hasSection ?section .
      ?indiv :grade_course ?course .
   } GROUP BY ?student ?section ?course
   HAVING (stcount = 1 && ?secount = 1 && ?ccount = 1)
}

A bit akward syntactically, since the aggregates need to be computed by a SELECT statement. The ASK will return true if the 'constraints' (see the HAVING clause) are all true and false otherwise.

For future reference the SHACL (RDF Shapes Constraint Language) work at W3C is intended to shore up these kinds of constraint violation problems that are not possible to answer with OWL.

scotthenninger
  • 3,921
  • 1
  • 15
  • 24
  • We're getting somewhere. Thank you. Now, referencing blank node instances is not a goal here; tightly defining the properties via domain (and range) restrictions is. Above, is my attempt in description logics to do this... Your SPARQL query is what I want to enforce in an OWL R-Box... Does the DL attempt above properly denote this restriction? And would it's OWL correlary be valid, too? **+1 for the query and providing a reference.** – JohnG79 Feb 16 '16 at 03:57
1

If I understand your intent correctly, you want these restrictions to apply to any use of these properties rather than only for a specific class.

Under this assumption, you can achieve this by declaring the properties functional and setting their domain to C. In Functional syntax:

Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)

Ontology(
Declaration(Class(<urn:test:C>))
Declaration(ObjectProperty(<urn:test:hasSection>))
Declaration(ObjectProperty(<urn:test:hasStudent>))
Declaration(DataProperty(<urn:test:grade_code>))

FunctionalObjectProperty(<urn:test:hasSection>)
ObjectPropertyDomain(<urn:test:hasSection> <urn:test:C>)

FunctionalObjectProperty(<urn:test:hasStudent>)
ObjectPropertyDomain(<urn:test:hasStudent> <urn:test:C>)

FunctionalDataProperty(<urn:test:grade_code>)
DataPropertyDomain(<urn:test:grade_code> <urn:test:C>)

SubClassOf(<urn:test:C> ObjectIntersectionOf(ObjectSomeValuesFrom(<urn:test:hasSection> owl:Thing) ObjectSomeValuesFrom(<urn:test:hasStudent> owl:Thing) DataSomeValuesFrom(<urn:test:grade_code> rdfs:Literal)))
)
Ignazio
  • 10,504
  • 1
  • 14
  • 25
  • Thanks for your reply! So my goal is to describe the ontology in the figure without giving the blank node a type. I'm wanting to restrict the domains of its properties (which you have done) not by giving the blank node a type and referring to it, but by describing the node. – JohnG79 Feb 10 '16 at 20:15