loopasam / brain Goto Github PK
View Code? Open in Web Editor NEWLibrary for biomedical knowledge manipulation
Library for biomedical knowledge manipulation
According to this example queries using getSubClassesFromLabel should work for labels with spaces as long as those labels are quoted. This does not appear to be the case. A simple example:
Brain pato = new Brain();
pato.learn("http://purl.obolibrary.org/obo/pato.owl");
List<String> colors = pato.getSubClassesFromLabel("color", false); // This works
for (String subClass : colors) {
System.out.println("Subclass of color: " + subClass);
}
List<String> oqs = pato.getSubClassesFromLabel("'optical quality'", false); // doesn't work
for (String subClass : oqs) {
System.out.println("Subclass of 'optical quality: " + subClass);
}
}
I'm particularly keen to be able to edit annotation property axioms using Brain. A method allowing deletion would be fine for this. A deleteAnnotation method could take the same form as the annotation method:
brain.deleteAnnotation("MyEntity", "MyAnnotationProperty", "MyValue");
When combined with a modified getAnnotation that returns lists (#10 (comment)), this feature would make it easy to use Brain for scripted editing of ontologies.
Could existing methods (disjointClasses, subClassOf, equivalentClasses) be extended to take class expression? Currently, doing this doesn't throw an error. It just silently fails:
(Code is Jython - but should be clear to read)
from uk.ac.ebi.brain.core import Brain
test = Brain()
test.addClass("foo")
test.addClass("bar")
test.addObjectProperty("part_of")
test.disjointClasses("part_of some bar", "part_of some foo")
test.subClassOf("part_of some bar", "part_of some foo")
test.equivalentClasses("part_of some bar", "part_of some foo")
test.save("tmp.owl")
=>
Ontology: <brain.owl>
ObjectProperty: part_of
Class: owl:Thing
Class: foo
Class: bar
Add some more doc regarding this, it's confusing atm. Also specify the import
Java statement in the first example. Some sleep() methods are still missing from the doc
Bug:
brain.learn("http://purl.obolibrary.org/obo/fbbt-simple.owl");
brain.save("/home/samuel/Desktop/fbbt-simple.owl");
brain.learn("/home/samuel/Desktop/fbbt-simple.owl"); //Produce a parsing error because of prefixes not kept
It would be very useful if Brain provided a method for checking whether an OWL entity of a specified URI & type already exists in a Brain instance.
(Looks like the latest versions of the OWL-API have methods useful to this aim under the OWLOntology class, e.g. OWLOntology.containsEntityInSignature(IRI entityIRI) )
OBO translations of OWL ontologies use annotation of axioms for a number of purposes. Being able to retrieve, delete and add these is critical if Brain is to be useful as a scripted editing environment for these ontologies.
Shall Brian enforce one unique rdfs:label per entity?
It is not possible to retrieve top level properties at the moment except for Thing. Would be cool to have too: brain.getOWLObjectPorperty("topObjectProperty");
Hello.
I'm working with ontologies on android. I'm trying to use the Brain tool, however Brain requests some 'java.beans' classes. I do not have these classes. How do I get the tool to work?
The error follows.
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.beans.Introspector" on path: DexPathList[[zip file "/data/app/[my_path].teste3-1/base.apk"],nativeLibraryDirectories=[/data/app/[my_path].teste3-1/lib/x86, /system/lib, /vendor/lib]]
It is not possible to configure the number of workers of the Elk reasoner at the moment.
Request to be able to retrieve the array of annotations
Could you add documentation for how to convert a Brain object into one that can be used with OWL-API methods?
The OWL individuals are not handled at the moment.
In 1.4.3:
test = Brain()
test.addClass("5ca4b0f0-23b3-11e4-b0bd-a8206614dd49")
<brain#5ca4b0f0-23b3-11e4-b0bd-a8206614dd49>
test.knowsClass("5ca4b0f0-23b3-11e4-b0bd-a8206614dd49")
True
test.getSubClasses("Thing", 0)
[5ca4b0f0-23b3-11e4-b0bd-a8206614dd49]
But in 1.5.1:
test = Brain()
test.addClass("5ca4b0f0-23b3-11e4-b0bd-a8206614dd49")
<brain#5ca4b0f0-23b3-11e4-b0bd-a8206614dd49>
test.knowsClass("5ca4b0f0-23b3-11e4-b0bd-a8206614dd49")
False
test.getSubClasses("Thing", 0)
[ca4b0f0-23b3-11e4-b0bd-a8206614dd49]
Note the missing first digit. Only digits seems to be affected. All leading digits are removed during class generation. No errors are thrown. The same issue is seen when loading from a file.
Check whether or not a class is already present in the ontology, in order to avoid error handling.
A brain based web service for EL queries would be extremely useful, especially if we can come up with a nice clean RESTful implementation. Returning IDs/URIs would be sufficient, but returning rdf-xml for terms would be even better.
Happy to help out in any way if you are interested in implementing this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.