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

Add language tags to annotation selectors #574

Merged
merged 5 commits into from
Oct 29, 2019
Merged

Add language tags to annotation selectors #574

merged 5 commits into from
Oct 29, 2019

Conversation

beckyjackson
Copy link
Contributor

@beckyjackson beckyjackson commented Oct 2, 2019

See #571 - allows selecting annotations with language tags with remove and filter:
CURIE='literal'@language, e.g. rdfs:label='example label'@en

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will address the use case in #571 to match all literals with a given language tag.

@beckyjackson
Copy link
Contributor Author

Ah, I see, I was looking at your comment. We don't have a datatype/language selector but we could do something like: --select CURIE=@en and --select CURIE=^^xsd:string?

Then you could accomplish this with:

robot remove --input in.owl \
  --select "rdfs:label=@en" \
  --select complement \
  --select classes \
  --include-term rdfs:label \
  --trim false \
  --axioms annotation \
  --output out.owl

Note that --include-term is coming from #570. Ideally, we would merge this first to avoid any merge conflicts...

This selects all entities labeled with an @en language tag, then gets the complement of that (so everything without an @en label). Then, it selects only the classes from that set - so you're left with all classes that do not have an @en label. You include rdfs:label in the final set of objects.

--trim false means that only axioms containing objects in the selected set (all those classes plus rdfs:label) are returned. Then, the --axioms annotation option makes sure only annotation axioms are selected, and not any logical connections between these classes.

@jamesaoverton
Copy link
Member

--select CURIE=@en and --select CURIE=^^xsd:string sound good.

I think the goal in #571 is just to remove the rdfs:label=@en annotations, not to remove any of the classes.

@beckyjackson
Copy link
Contributor Author

Yeah - the above command does that with the --include-term. I'll make the changes to add the language and datatype selectors here, but I'll wait on --include-term for #570.

@jamesaoverton
Copy link
Member

Ok, I reread #571 and now I think I understand. The general goal is to remove all the rdfs:labels that are not @en or plain literals. That's complicated. But there's a sub-goal that this PR will support with just remove --select 'rdfs:label=@zh'.

@jamesaoverton jamesaoverton merged commit 472256b into master Oct 29, 2019
@beckyjackson beckyjackson deleted the 571-fix branch October 31, 2019 15:27
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

Successfully merging this pull request may close these issues.

2 participants