Replies: 14 comments
-
I have been exploring FIBO with the OWL-API using ammonite, which I highly recommend.( An idea: one could write such scripts and tie these into the repository to test any commit made to it. I will later try to publish a git repo with the scripts I am using.) Loading the full ontology from https://spec.edmcouncil.org/fibo/ontology/master/2020Q1/LoadFIBOProd.rdf which loads 131 ontologies, I find that most of the ontologies only fit OWL-FULL. Looking at OWL-RL I find a lot of errors such as the following,
I think this is because you have a union on the right of ⊑ which is the key restriction for all of the RL, EL and QL Descriptions Logics according to the article by Markus Krötzsch. Another one:
To take a different ontology
Here we have an |
Beta Was this translation helpful? Give feedback.
-
Hi Henry, FIBO is intended to be OWL DL compliant for the production / released ontologies. No claim about the status of those that are provisional. We haven't attempted to stay within the RL profile for a number of reasons, including but not limited to use of cardinalities of greater than 1 in some restrictions. Having said this, I'll take a look at some of the unions you've identified and see if we can either insert additional subclass axioms or split the cases where we have unions of different sorts into independent restrictions without losing too much of the intended semantics. The combination in the case of addresses was intended to say that you have either one or the other but not both cases, so replacing the union with two separate restrictions, and making each optional, doesn't capture the intent. But I'll talk through the issues with Dean and others and will relax some of the constraints to use two independent optional restrictions if that's what the group thinks we should do. We've been using a number of syntax checking tools, plus Pellet Lint and other things to weed out errors to date, but perhaps Pellet is more lenient than HermiT in the cases you've identified. |
Beta Was this translation helpful? Give feedback.
-
Here are all the OWL superclass errors that the OWL-API gave me for the released version on the OWL RL profile. I have not filtered out the serious ones, as that would require a lot more work. But I thought you may find it useful. |
Beta Was this translation helpful? Give feedback.
-
Great - thanks! I'll walk through them with Dean and we'll determine which ones we can safely eliminate, and which to retain. We should also identify the ones we retain in our documentation so that anyone that wants to use OWL RL with FIBO can address them as appropriate for their use case. |
Beta Was this translation helpful? Give feedback.
-
This would be another useful addition to the Hygiene tests for Production. |
Beta Was this translation helpful? Give feedback.
-
Actually, I am not sure that we have said we will stay within OWL RL - so I would not want to add such a hygiene test, but I'll take a look at the pattern and see if there are ways to either address these by creating additional classes (although they may be contrived, which I'm not in favor of, so we'll have to see), or something. But we should at least take a look and see if there are better ways of saying what is intended. |
Beta Was this translation helpful? Give feedback.
-
Here are the OWL-DL profile errors that I gathered from OWL-API when loading the data from the github repository. They are not very serious but it could be useful to run a little program to write a report when people make a PR. (We did something similar in our Scala projects using Travis which runs a bunch of unit tests when someone PRs or when we accept one). Such a report could be filled in with other things to watch out for. Ah I see that there is mention of hygiene tests on the front page of FIBO development (but no link to source code). |
Beta Was this translation helpful? Give feedback.
-
Btw. the key graphic I was going on from Markus Krötzsch OWL 2 Profiles: An Introduction to Lightweight Ontology Languages is the one below. The lack of union on the right is consistently avoided by the three OWL Profiles EL, QL and RL. I put a red cross in the space to highlight that. As I understand the article there are fundamental complexity issues with having those. But I am not an expert in this area, the article is 8 years old, there may be workarounds, ... |
Beta Was this translation helpful? Give feedback.
-
I wrote an ammonite script to collect these errors so it could work from a local git clone. Once ammonite (and scala installed) you can just run it like this setting the right paths for the files. It also comes with help. amm findErrors.sc /Users/hjs/Programming/RDF/OWL/fibo/AboutFIBODev.rdf err import $ivy.`net.sourceforge.owlapi:owlapi-distribution:4.5.16`
import $ivy.`org.slf4j:slf4j-jdk14:1.7.29`
import org.semanticweb.owlapi.model.OWLOntology
import os._
import scala.collection.mutable
import scala.jdk.CollectionConverters._
import org.semanticweb.owlapi.profiles._
import org.semanticweb.owlapi.util._
import org.semanticweb.owlapi.model.parameters.Imports
import org.semanticweb.owlapi.model._
import org.semanticweb.owlapi.apibinding.OWLManager
import java.io.File
//to run with debuggin enabled run
//JAVA_OPTS="-Xmx4g -Djava.util.logging.config.file=$HOME/java.logging" amm findErrors.sc
//
// such a $HOME/java.logging properties file could contain
//handlers=java.util.logging.FileHandler
//java.util.logging.FileHandler.pattern=/Users/hjs/java.log
//java.util.logging.FileHandler.level = FINEST
//sun.net.www.protocol.http.HttpURLConnection.level=ALL
/** @param file: the file in a local repo from which others can be loaded **/
def loadGit(file: File ): OWLOntology = {
val iMap = new AutoIRIMapper(file.getParentFile, true)
val man = OWLManager.createOWLOntologyManager()
man.getIRIMappers.add(iMap)
iMap.update()
println("loading ontology from $file")
man.loadOntologyFromOntologyDocument(file)
}
def verify(ont: OWLOntology, profile: Profiles): mutable.Seq[OWLProfileViolation] =
profile.checkOntology(ont).getViolations.asScala
@doc("load ontology and dependencies and test for DL and RL profiles")
@main
def main(ontRoot: java.io.File @doc("the ontology to load"),
pre: String @doc("the prefix for error files written") = "errors"
) = {
val ont = loadGit(ontRoot)
import Profiles._
def err(prof: Profiles) = temp(dir =pwd,prefix=s"$pre.",suffix=s".${prof}.txt",deleteOnExit = false)
List(OWL2_DL,OWL2_RL).foreach { prof =>
println(s"checking for $prof compliance")
val x = prof.checkOntology(ont)
val errorFile = err(prof)
println(s"writing output to $errorFile")
write.over(errorFile,
x.getViolations.asScala.mkString(
s"Errors for ${prof.getName} in ${ontRoot.getParent}\n"+
s"Is In Profile: ${x.isInProfile}\n"
, "\n#--> ", "\n")
)
}
} It took me a quite some time to find out how to get the local files and not the remote ones.
That is of course ok. I found the following errors in the logs files running it with logging enabled. <message>Unparsed triple: https://spec.edmcouncil.org/fibo/ontology/SEC/Equities/EquityCFIClassificationIndividuals/ESVUFR
->
http://www.w3.org/1999/02/22-rdf-syntax-ns#type -> _:genid2147487528</message> |
Beta Was this translation helpful? Give feedback.
-
Hi Henry, I'm in the process of moving machines, but once I've done so I may reach out to work with you to add the infrastructure to my environment. What are you running all this on? I know there are issues with the CFI codes and blank nodes - we added those recently to show how to encode them, and I need to refactor them, so this isn't a surprise, but thanks for the confirmation on those. I'm also planning to add a couple more reasoners to see what kinds of results we get with those - Uli maintains a list of some I am not familiar with. If you have tried any of them, let me know. I am planning to reach out to Ian Horrocks to get some thoughts on their recent work in that area as well. |
Beta Was this translation helpful? Give feedback.
-
From the list of DL errors, most of these are in provisional ontologies, not released ontologies, which is a relief :). I'll fix the one you've identified in released ontologies (1 in addresses - which was missing an import) ASAP; the others will be fixed as we work through those ontologies, but really appreciate this. |
Beta Was this translation helpful? Give feedback.
-
I am running this on my 1½ year old MacBookPro laptop (32GB of RAM). brew install ammonite-repl Before that one also has to install XCode Command line utilities. |
Beta Was this translation helpful? Give feedback.
-
Hi Henry, I work in a Windows environment, but it's likely that we can implement these tests on another machine. Thanks very much for all the work you've done on this! One question - in spot checking some of the results, I was surprised to see that so many restrictions failed the RL test. allValuesFrom seem to be ok, but not even very basic someValuesFrom restrictions. Those should be supported according to the spec, as should any min cardinality restriction that is not greater than 1 (although one can work around that). There are things that we do here and there that I would expect to fail, such as min cardinality of 2, and perhaps some of our more complex restrictions and a few custom datatypes, but we don't use some of the obvious suspects (reflexive properties, disjoint unions, etc.). In any case, you might take another look at the RL errors you've generated and see if the rules are overly restrictive. Best, Elisa |
Beta Was this translation helpful? Give feedback.
-
The errors I posted above are what the OWL-API returned when running OWL2_RL.checkOntology(ont) (I think I was running OWL2_RL but I can't be sure anymore) According to Markus Krötzsch's article not all restrictions for each of the OWL Profiles are important. Btw. That script could easily be turned into a small program to produce a jar, that can be run with java. There is a huge advantage though of working with OWL-API from the Btw. I have just published the scripts in the OWL-API-Play repository on github. |
Beta Was this translation helpful? Give feedback.
-
I read the very helpful 2012 article by Markus Krötzsch OWL 2 Profiles: An Introduction to Lightweight Ontology Languages and was wondering if FIBO aims at a particular profile, eg. OWL DL, RL or QL or some newer variant?
Reasoning seems to saturate with Hermit in Protégé. (it seems to finish after at least 6 hours of reasoning). I could not tell with Stardog as that uses query rewriting to answer questions and took forever to answer some questions (especially DESCRIBE ones when I set DL reasoning on).
Is FIBO engineered to satisfy a particular reasoning profile? I am especially interested to know if all the consequences can be deduced from FIBO, or FIBO + instance data.
Beta Was this translation helpful? Give feedback.
All reactions