Hi Guys.

I have a large ontology in which multiple domains of both object and
datatype properties have been defined individually. e.g.

vocabProperty:hasChain
      rdf:type owl:ObjectProperty ;
      rdfs:domain vocabClass:Antibody, vocabClass:Structure;
      rdfs:range vocabClass:Chain .

These should be union domains for it to work properly
e.g.

vocabProperty:hasChain
      rdf:type owl:ObjectProperty ;
      rdfs:domain
              [ rdf:type owl:Class ;
                owl:unionOf (vocabClass:Antibody vocabClass:Structure)
              ] ;
      rdfs:range vocabClass:Chain .

I could go through and edit the file by hand, but that's going to take
some time.
I'd prefer to use a sparql construct in a sparql motion script to do
it,
but I can't quite get it right.

I have a script which ImportsRDFFromWorkspace then has an
iterateOverSelect with the sparql
SELECT ?prop
WHERE {
         ?prop a owl:DatatypeProperty .
    LET (?count := smf:countResults("SELECT ?domain WHERE { ?prop
rdfs:domain ?domain.}")) .
    FILTER (?count > 1) .
}

Then I have an ApplyConstruct linked to the body
With the following as sparql
CONSTRUCT {
    _:b0 a owl:Class .
    _:b0 owl:unionOf ?domain .
    ?prop rdfs:domain _:b0 .
}
WHERE {
    ?prop rdfs:domain ?domain .
}

This gets me somewhere near where I want to be.
But I now have multiple union domains each with a single domain in it.

So I'm a biscuit short of packet and I can't seem to find that magic
statement that puts all the domains for a property in one unionOf
statement.
Can you help?
Cheers

Phil

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to