tgbugs / ontquery

a framework querying ontology terms
MIT License
3 stars 3 forks source link

Implementing an interlex client for old php endpoints within /plugins/services #9

Closed tmsincomb closed 5 years ago

tmsincomb commented 5 years ago

NOTE: add_entity is used for add_pde TODO: add_triple not used yet for annotation upload regarding data in add_entity

tmsincomb commented 5 years ago

My current question is how to return the predicates. Can you give me an example of sample data that would be given to the predicates parameter and the expected output please?

tgbugs commented 5 years ago
{'NIFRID:synonym': 'method',
 'definition:': 'A repeatable process that is constrained by some prior information.',
 'ilxtr:hasTempId': OntId('HBP_MEM:0000000'),
 'owl:equivalentClass': rdflib.term.BNode('ub3bL542C25'),
 'rdf:type': OntId('owl:Class'),
 'rdfs:subClassOf': rdflib.term.BNode('ub3bL560C9')}

Clearly we would not return the BNodes, but this should be the input and the output. The curies should be expanded via self.user_curies. The easiest way is to add user_curies to OntCuries e.g. as in https://github.com/tgbugs/ontquery/blob/master/test/test_qname.py#L7 and then call {OntId(k):v for k, v in prefixes.items()} or something like that.

tmsincomb commented 5 years ago

So just to be clear, based on your example of a single dictionary, we only want 1 annotation type per entity? For example, what if they wanted to add duplicates of the same annotation type "Sources ", but with different values. A single dictionary wouldn't allow this unless the value is a list. Is this the intention?

tgbugs commented 5 years ago

Ah no, that was a bad example (and possibly the result of a bug). If there is more than one value it should be a list.