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

Querying annotation property with SQWRL engine? #69

Open
soda-hobart opened this issue Nov 11, 2020 · 2 comments
Open

Querying annotation property with SQWRL engine? #69

soda-hobart opened this issue Nov 11, 2020 · 2 comments

Comments

@soda-hobart
Copy link

Is it possible to query the value of an annotation property using the SQWRL API?
I tried to run this query:
"skos:prefLabel(?i, ?label) -> sqwrl:select(?label)"
But got an invalid SWRL predicate error.

I know that the label exists and that the prefix-manager is working properly because, with other functions and queries in my program, using that namespace and annotation, I was able to get the expected result.

(find-annotation my-ontology :skos/prefLabel 
  (.toString 
    (.getIRI 
      (:c (first 
        (result-rows ((sqwrl-query sqwrl "skos:Concept(?c) -> sqwrl:select(?c)"))))))))

I added a data property assertion to my ontology concerning the same individual, for "skos:prefLabel", and I was able to retrieve the literal result of that expression.
(result-rows ((sqwrl-query sqwrl "skos:prefLabel(?i, ?label) -> sqwrl:select(?label)")))

I guess I could just convert selected annotation property assertions to data property assertions for use with SQWRL? A lot of the bibliographic formats tend to be almost entirely implemented as annotation properties, for some reason.

@martinjoconnor
Copy link
Member

I'm afraid that there is no way of querying annotation properties in SQWRL. SQWRL is built-on SWRL, which also does not allow annotation properties to be used in this way.

@soda-hobart
Copy link
Author

Thanks for confirming that. It makes sense, given that avoiding a bunch of pattern matching on string labels is one of the main reasons for the Semantic Web.

So much of the bibliographic linked data tends to have the actual data as the value of some sub-property of rdfs:label. Sure, it's a label, but it's also data! It would be nice to be able to reason over some of that stuff, like, for instance, writing a rule that classes together people with names that have a certain suffix (Jr., Sr., III, etc).

I guess I will look at some work-arounds, like writing a script to duplicate annotation properties as data properties, or maybe using SPARQL, and/or adding some functions to my pipeline that will shim that stuff up a little.

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