Comments (6)
Here's a first pass at a JSON-LD file with common prefixes and prefixes for every OBO project:
So far I've tested it at on the JSON-LD playground and it's seems to work as expected.
I'd like this to be a comprehensive default, so let me know if I've missed anything important.
The rest of the commit parses the JSON-LD into a map of prefixes, then loads those into an OWLAPI PrefixManager.
from robot.
Any prefix that itself includes an underscore is potentially ambiguous
in the reverse translation. I think we're OK just now but something to
be aware of. I think we wouldn't allow new ones now
Hmm, vHOG should really be VHOG (but not a big deal now VHOG was
superseded by UBERON)
On 15 Apr 2015, at 12:33, James A. Overton wrote:
Here's a first pass at a JSON-LD file with common prefixes and
prefixes for every OBO project:So far I've tested it at on the JSON-LD
playground and it's seems
to work as expected.I'd like this to be a comprehensive default, so let me know if I've
missed anything important.The rest of the commit parses the JSON-LD into a map of prefixes, then
loads those into an OWLAPI PrefixManager.
Reply to this email directly or view it on GitHub:
#9 (comment)
from robot.
We're now using the JSON-LD Java library to parse contexts, then build an OWL PrefixManager/ShortFormProvider. These are the command-line options I have in mind for controlling prefixes:
- no prefix options: use the default prefixes from
obo_context.jsonld
--no-prefixes
do not use the default prefixes--prefixes FILE
(-P FILE
) use your own JSON-LD file instead of the default prefixes--prefix "foo: http://foo.com#"
(-p PREFIX
) add one prefix to the current set of prefixes (may be used multiple times); this should be convenient for projects that have not yet requested an OBO namespace
The --prefixes
option will override the --no-prefixes
option (it doesn't make sense to use them together). The --prefixes
option can only be used once (I think that Apache CLI will take the first). There may be multiple --prefix
options, and they will be added after the choice is made between the defaults, --no-prefixes
, and the user's --prefixes
file.
If you use --prefixes
, your JSON-LD file should have a @context
key. Otherwise you'll get an empty set of prefixes. The JSON-LD library should try to fetch external contexts. I haven't tested that yet, and it opens the doors to network failures and other unexpected behaviour, but it's an advanced option.
The command-line tool allows multiple subcommands. If the prefix options come before all subcommands, then they are global options that apply to all subcommands. If they come after a subcommand then they only apply to that subcommand. This is our general option scoping rule for subcommands.
This is a little more complicated than I would like, but it's fully configurable, and I think it all follows the principle of least surprise.
from robot.
As I was sitting down to implement this, I noticed that a piece is missing. We should be able to write the current prefixes to a file (or print to console). This will also enable integration testing.
So I plan to add a export-prefixes
command that will write JSON-LD. (The name is clumsy, but I like to start every command name with a verb. The verb could be "show" or "write" instead of "export".) If needed, we can add Turtle and SPARQL formats.
from robot.
{export,dump}-prefixes
OK with me
from robot.
Had to use --noprefixes
instead of --no-prefixes
because of Apache CLI option parsing rules.
Closed by commit 6153ee7
from robot.
Related Issues (20)
- Export command does not export a column for "rdfs:isDefinedBy" HOT 1
- Integration test for extract subset failing in CI HOT 5
- `analyze`: Add command for measuring the impact/power of individual axioms.
- ROBOT query --update strips prefixes when output is not .owl (RDF/XML) HOT 3
- Ignoring duplicate exact synonyms that are acronyms in robot report HOT 8
- Should `validate-profile` recognize `owl:onProperties`? HOT 6
- Including object properties HOT 4
- Having robot capture kinds of dbxref annotation HOT 2
- relax is currently incomplete HOT 4
- Extract produces strangeness -> OBO Graph error HOT 6
- Alternative ways of removing imports HOT 4
- diff feature request: sort axioms in Added and Removed sections in Markdown output HOT 4
- Add `--allow-duplicate-entities` as option in ROBOT rename HOT 4
- robot remove --axioms external is removing an internal axiom HOT 4
- 'MISSING MIREOT TERMS ERROR' that can't be resolved HOT 3
- BUG: robot template with class expressions duplicates classes as datatypes HOT 12
- Implement a cycle check over relation graph HOT 1
- Unclear expressivity results from robot measure HOT 6
- reduce not removing axioms where one relationship is a subproperty of another between the same two classes
- How to trigger datatype property range review? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robot.