Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owl:FunctionalProperty is wrongly interpreted #13

Closed
severin-lemaignan opened this issue Jun 20, 2022 · 11 comments
Closed

owl:FunctionalProperty is wrongly interpreted #13

severin-lemaignan opened this issue Jun 20, 2022 · 11 comments

Comments

@severin-lemaignan
Copy link

When a predicate is set to be an OWL functional property, it appears to add spurious owl:sameAs relationships.

The following minimal example exhibits the error with rdflib 4.2.2 and reasonable 0.1.53 (installed via pip)

import reasonable
import rdflib

g = rdflib.Graph() 

r = reasonable.PyReasoner() 

N3_PROLOGUE='@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. @prefix owl: <http://www.w3.org/2002/07/owl#>. @base <http://example.org>.  @keywords a,true,false.  '

g.parse(data=N3_PROLOGUE + " p1 rdf:type owl:FunctionalProperty .", format="n3") 
g.parse(data=N3_PROLOGUE + " s1 p1 o1 .", format="n3") 
g.parse(data=N3_PROLOGUE + " s2 p1 o2 .", format="n3") 

r.from_graph(g) 
triples = r.reason()

triples

triples lists o1 owl:sameAs o2 which should not be inferred.

@severin-lemaignan
Copy link
Author

@gtfierro gentle ping!

@gtfierro
Copy link
Owner

Apologies! And thanks for the reminder :) This got away from me; I've got a deadline Friday but I can get back to this early next week

@severin-lemaignan
Copy link
Author

brilliant. Let us know if you need help testing things.

@gtfierro
Copy link
Owner

gtfierro commented Aug 6, 2022

Hi @severin-lemaignan ; I believe I fixed the bug here, and it should be released in reasonable==0.1.59.

I had a little trouble getting the Python package to build again, but I think it is all working now. Can you give it a try?

@severin-lemaignan
Copy link
Author

severin-lemaignan commented Aug 16, 2022

hi! thanks for working on this!
After upgrading the python bindings to reasonable-0.1.64, I get this error:

>>> import reasonable
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/severinlemaignan/.local/lib/python3.8/site-packages/reasonable/__init__.py", line 4, in <module>
    from reasonable.reasonable import PyReasoner
ImportError: cannot import name 'PyReasoner' from 'reasonable.reasonable' (/home/severinlemaignan/.local/lib/python3.8/site-packages/reasonable/reasonable/__init__.py)

Does it ring a bell? missing dependency?

@gtfierro
Copy link
Owner

gtfierro commented Aug 16, 2022 via email

@severin-lemaignan
Copy link
Author

Ubuntu 20.04, x64

@gtfierro
Copy link
Owner

Can you try v0.1.65? I was able to install that successfully

@severin-lemaignan
Copy link
Author

Same issue. Tested with Python 3.8.10, on Ubuntu 20.04:

$ pip3 install --upgrade reasonable
Collecting reasonable
  Downloading reasonable-0.1.65-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (95.6 MB)
...
  Successfully installed reasonable-0.1.65

$ python3
> import reasonable
ImportError                               Traceback (most recent call last)
<ipython-input-1-cb465344bbbe> in <module>
----> 1 import reasonable
      2 import rdflib
      3 
      4 g = rdflib.Graph()
      5 

~/.local/lib/python3.8/site-packages/reasonable/__init__.py in <module>
      2 Python interface to reasonable
      3 """
----> 4 from reasonable.reasonable import PyReasoner

ImportError: cannot import name 'PyReasoner' from 'reasonable.reasonable' (/home/skadge/.local/lib/python3.8/site-packages/reasonable/reasonable/__init__.py)

@severin-lemaignan
Copy link
Author

Same issue reported in #17

@severin-lemaignan
Copy link
Author

FYI, reasonable-0.1.59 works well (and the original bug is fixed). As the issue with v. > 0.1.59 is tracked in #17, I close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants