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

Allow DESCRIBE to return the (asymmetric) CBD #4857

Open
VladimirAlexiev opened this issue Dec 15, 2023 · 0 comments
Open

Allow DESCRIBE to return the (asymmetric) CBD #4857

VladimirAlexiev opened this issue Dec 15, 2023 · 0 comments
Labels
📶 enhancement issue is a new feature or improvement

Comments

@VladimirAlexiev
Copy link

VladimirAlexiev commented Dec 15, 2023

Problem description

We want to extract all statements about ontology terms that are rdfs:isDefinedBy a certain ontology, so as to provide them to LLM for the purposes of SPARQL generation. We want to use DESCRIBE because it traverses blank nodes, so it takes care of patterns like this:

P rdfs:domain [a Class; owl:unionOf (C1 C2)].
C1 rdfs:subClassOf [a owl:Restriction; owl:onProperty p; owl:allValuesFrom C2]
  • DESCRIBE of a property P works great
  • but DESCRIBE of a class C is problematic, since in rdf4j, DESCRIBE returns the symmetric CBD (SCBD), i.e. all incoming and outgoing props of the node. So it returns all instance triples "X a C". We can filter them out with some post-processing, but in a large database fetching those instance triples takes a long time (just to discard them afterwards).

Preferred solution

Add some feature to control DESCRIBE. The following databases do it with hint:Query:

Another option could be to use FROM with a special named graph.

Are you interested in contributing a solution yourself?

None

Alternatives you've considered

No response

Anything else?

No response

@VladimirAlexiev VladimirAlexiev added the 📶 enhancement issue is a new feature or improvement label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📶 enhancement issue is a new feature or improvement
Projects
None yet
Development

No branches or pull requests

1 participant