-
Notifications
You must be signed in to change notification settings - Fork 75
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
'remove' based on language attributes #571
Comments
Hmm. It looks like we don't support selection by language tags in The My best suggestion with current ROBOT features is to use SPARQL UPDATE:
where
That should work, but I haven't tested it. More documentation here: http://robot.obolibrary.org/query#sparql-update |
Thanks very much. Will keep an eye out on the remove/filter command. In the meantime, your sparql update suggestion worked perfectly. For reference, here is the .ru file I used in the end: # Delete any rdfs:label where the language is set to 'zh'
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
DELETE {
?class rdfs:label ?display_name
}
WHERE {
?class rdf:type owl:Class.
?class rdfs:label ?display_name
FILTER(lang(?display_name) = "zh")
} |
New selectors added by #574: This doesn't quite cover this use case, but I think SPARQL UPDATE is still the right method to do this. That said, these new selectors allow you to select terms based on their annotations, so you could remove the labels on any terms that have a given language tag:
Note that this will remove all labels on any term that has an @allysonlister - did the SPARQL UPDATE work out for you? Is this issue OK to close? Thank you! |
Thanks very much! And yes, the SPARQL UPDATE worked great for me - I included the code above for reference. I'm happy for you to close the ticket - just didn't want to do it myself in case you were waiting for something internally first. Thanks again for all your help :) Allyson |
Great, thank you! |
Just came across the same, wanting to remove all labels (all annotations for that matter) that were Chinese. Using sparql as well, thanks all. |
I would like to remove all rdfs:labels that have anything other than "anystring"@en, also preserving those rdfs:labels that have no language attribute set.
To try to get this started, I attempted to just remove those labels that have "anything"@zh as follows (a good test ontology for this is CLO at http://www.clo-ontology.org/ as it has multiple languages):
However the above statement removes all labels whether or not they have a language set. I can't help feeling that I'm circling around the appropriate command, but I just can't see it. Please could I have some pointers?
Thanks :) Allyson
The text was updated successfully, but these errors were encountered: