Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Johan Wilhelm Klüwer
@johanw_gitlab
The idea would be, take a template and make a sparql query from the template definition. This was actually a feature in an earlier version of Lutra, so there's hope.
Ghost
@ghost~5f107a59d73408ce4fe9c26d
Thank you @johanw_gitlab, i was actually resolving this assigning a triple to the template I'm interested to extract. I defined a pattern :PatternInstance(?iri, ?pattern) :: { ottr:Triple( ?iri, :isInstanceOf , ?pattern ) }. And i reuse it inside the templates i'm interested to extract. Then i can simply query with: SELECT ?instance WHERE { ?instance :isInstanceOf <my_pattern> }
Ghost
@ghost~5f107a59d73408ce4fe9c26d
Does someone know the correct procedure to publish templates online? Such that i can fetch them remotely with lutra argument --fetchMissing ? Do i need to expand them and store them as pure RDF? It's okei to declare all the templates in a file and resolve them via hash dereferentiation? I tried like this but didn't work ottr/lutra/lutra#259
Daniel
@dalupp_gitlab
Hi Christian! As Johan mentioned, we don’t have a way of querying for patterns yet. Your approach works well with ontologies generated with templates, but how to query ontologies not built with templates (where the template instances are not explicitly listed) is future work, and quite high up on our priority list. Regarding the —fetchMissing, your templates need to be hosted at the address as specified in the template’s IRI.
Ghost
@ghost~5f107a59d73408ce4fe9c26d
Thank you @dalupp_gitlab ! Yes, it would be really nice to have that query. At the moment i'm rescaling the data using the wonderful argumentMap feature. That is i query against my dataset and shape the data according to a specified template.
here's where i'm hosting the template http://arco.istc.cnr.it/tpl/odp#Collection. But whe i try to fetch that i get:
[ERROR] Unknown template http://arco.istc.cnr.it/tpl/odp#Collection.

[FATAL] Fetch missing template: http://arco.istc.cnr.it/tpl/odp#Collection
[FATAL] Attempts of parsing library on all available formats {wottr=xyz.ottr.lutra.wottr.WottrFormat@381d7219, stottr=xyz.ottr.lutra.stottr.StottrFormat@49fe3142, tabottr=xyz.ottr.lutra.tabottr.TabottrFormat@13fed1ec, bottr=xyz.ottr.lutra.bottr.BottrFormat@61c42416} failed with following errors:

[ERROR] Attempt of parsing templates as xyz.ottr.lutra.stottr.parser.STemplateParser@615e3f51 format failed:
[ERROR] Error reading stOTTR file: 'http://arco.istc.cnr.it/tpl/odp#Collection': http:/arco.istc.cnr.it/tpl/odp#Collection

[FATAL] Attempt of parsing templates as xyz.ottr.lutra.wottr.parser.WTemplateParser@f72203 format failed:
[ERROR] Error getting property value for ottr:parameters for subject 'odp-tpl:Collection'. Expected exactly 1 object, but got 0.
[ERROR] Error parsing RDF sourceString http://arco.istc.cnr.it/tpl/odp#Collection. null
[FATAL] [line: 8, col: 22] Undefined prefix: rdf
am i doing something wrong ?
Daniel
@dalupp_gitlab
try adding -F wottr to the command. The error occurs because it is reading your template as a stOTTR file, not a wOTTR file. Also, I noticed you use the odp-col prefix without defining it.
7 replies
generally youre missing multiple prefixes rdf:, ottr:and odp-col: as far as I can see
Ghost
@ghost~5f107a59d73408ce4fe9c26d
Hello everybody i was wondering:
1) is it possible to conditionally avoid a triple instantiation inside a template?
suppossed i have a template like
:Template[ ?param1, ?param2 ] :: {
    :Triple(?param1, a, :something),
    :Triple(?param2, a, :something)
}
and i won't :Triple(?param2, a, :something) not created
2 replies
Ghost
@ghost~5f107a59d73408ce4fe9c26d
2) can i merge two list or append element to list, is there a way o pattern to do this ?
4 replies
NestedTemplate[List<ottr:IRI> ?list] :: {
    cross
      |  ottr:Triple(++?list, rdf:type, rdf:Resource)
}

Template[List<ottr:IRI> ?list, ottr:IRI ?extraElement] :: {
    NestedTemplate((?list, ?extraElement)) ???
}
or i need to handle sperately the two?
Daniel
@dalupp_gitlab
A general comment concerning these features: OTTR is a restricted language on purpose. With greater expressivity comes greater complexity, and thus a higher point of entry. We wanted the formalism to adhere to notions of ontology patterns and provide a solid macro mechanism for this, with guaranteed termination of expansion etc. Other formalisms exist that are closer to programming languages, though, that support features such as conditionals (TawnyOWL being one of those).
Daniel
@dalupp_gitlab
By the way, we are holding a tutorial tomorrow, if you would like to join. More info here: https://ottr.xyz/event/2020-11-023-iswc/
Ghost
@ghost~5f107a59d73408ce4fe9c26d
Thank you @dalupp_gitlab . All these doubts emerged because i'm extracting unstructured (i mean structure as pattern) RDF data from a KG via SPARQL queries. There are cases in which the Template (based on Ontology Design Pattern) needs some arguments but they are not in the KG for some reasons (ex. the data is not there or we have a specialization of the pattern)
I will join the tutorial then
Ghost
@ghost~5f107a59d73408ce4fe9c26d
You're explanation for the expressivity of the language starts to make me clear what i can and what i cannot do
Nico Matentzoglu
@matentzn
Hey all, is there a recording of the full ISWC ottr tutorial?
Martin G. Skjæveland
@m.g.skjaeveland_gitlab
Hi @matentzn. Sorry, the tutorial was not recorded, but there are already videos that cover parts of the tutorial material here: https://ottr.xyz/#Screencasts. We plan to cover the missing parts soon. Meanwhile, large parts of the missing contents are found in form of a primer: http://primer.ottr.xyz.
Nico Matentzoglu
@matentzn

Thanks Martin.. Your docs are great; I just wanted a “quick” injection beyond your three videos on vimeo to help me sorting my understanding on a few things I dont understand quite yet (lists of complex expressions, like (R some (A1 and A2), R some (B1 and B2) etc, just want to know whether these are in theory possible). And beyond all the cool stuff you have, i need to know more about instance matching (from ontology and teemplate, extract all instances from an ontology). Lastly, I was trying to find out how far your string templating goes (generating labels, synonyms using filler terms similar to https://github.com/obophenotype/upheno/blob/68378084c5c0f0a069342a49fbb6f94071be7a8d/src/patterns/dosdp-patterns/abnormalLevelOfChemicalEntityInLocation.yaml#L32

No need to answer now, i will keep looking :)

Martin G. Skjæveland
@m.g.skjaeveland_gitlab

instance matching (from ontology and teemplate, extract all instances from an ontology)

This is not supported yet, but high on the list. The plan is to support converting an OTTR template into a SPARQL query whose results are the instances in the queried source. In the simple case, with no optionals and list expanders, this should be trivial, and was indeed implemented in ca. 0.2 version of Lutra.

string templating

We do not support this yet either, but intend to implement this as a separate functional language for manipulating terms. The idea is to separate term manipulations from "fact stating", which templates can be seen as. There will be libraries of functions like there are libraries of templates. Plan is to support xpath functions and then combinations of these.

(lists of complex expressions, like (R some (A1 and A2), R some (B1 and B2)

There are several ways to answer this. Could you say more what the end goal for this is?

Nico Matentzoglu
@matentzn

Thank you for the prompt answers! Sounds good! So it seems you have really funding to support Ottr? Are there long-term plans to develop support and maintain it?

Re the complex expression thing: its not actually that wild, because 90% of the cases are covered by R some A (a being atomic), akin to your Pizza and has-topping examples. However, there are some cases where you say want to define a disease in terms of genes causing it, with those genes being expressed in a specific location (like a cell type); note this example is for illustration only; dont know whether you would define it in such a way. So you would get things like C = Disease and (has cause some (Gene1 and expressed in Location1)) and (has cause some (Gene2 and expressed in Location2)) etc etc. Its not that important.. I am just charged with looking a bit around at existing templating systems. Thanks for you help!

Martin G. Skjæveland
@m.g.skjaeveland_gitlab

So it seems you have really funding to support Ottr? Are there long-term plans to develop support and maintain it?

Yes, we do. OTTR is developed within the SIRIUS centre: https://sirius-labs.no/ with several interested industry partners.

Martin G. Skjæveland
@m.g.skjaeveland_gitlab

Re the complex expression thing

You cannot really pass complex expressions as arguments, but you can represent them by a blank node which is then passed on, which can be seen in the Pizza example where a blank node "joins" two template instances:

ax:SubObjectAllValuesFrom(?pizza, ex:hasTopping, _:toppingsUnion),
rstr:ObjectUnionOf(_:toppingsUnion, ?toppings),

If the hasCause + expressedIn is a pattern, then this could be a case of the zip list expander.

But there are limitations, see example 5 in http://ceur-ws.org/Vol-2459/paper2.pdf

Martin G. Skjæveland
@m.g.skjaeveland_gitlab
Let me add that we have not yet discussed if and how to tackle the cases that are given in the above paper.
Nico Matentzoglu
@matentzn
That sounds all great and thank you very much for taking the time to consider it. I will come back to you after I have had a play.. Things are moving.. slowly.. here now! Thank you!
Martin G. Skjæveland
@m.g.skjaeveland_gitlab

Hi all, we are in the process of collecting input to steer the development of Lutra and OTTR. What are your favourite missing functionality/bugs/issues with Lutra and OTTR? Please send a list, add new issues to our issue list, or give votes to existing issues:

https://gitlab.com/ottr/lutra/lutra/-/issues

High on our list are:

Thanks!

Martin

Johan Wilhelm Klüwer
@johanw_gitlab
I'm about to read data from a csv file, using an H2Source in bottr. In the H2 documentation, it says you can switch the SQL dialect -- as in, "MODE=MSSQLServer " at http://www.h2database.com/html/features.html?highlight=MSSQLServer&search=mssql#firstFound -- is there a way to give this switch in the ottr:source declaration?
Martin G. Skjæveland
@m.g.skjaeveland_gitlab
@johanw_gitlab , the way to go is to use a jdbc source: https://spec.ottr.xyz/bOTTR/0.1/#2.3.3_JDBCSource. The ottr:H2Source is really just short hand for a H2 jdbc source. The jdbc driver should be set to org.h2.Driver.
Johan Wilhelm Klüwer
@johanw_gitlab
Great, thanks a lot!
Johan Wilhelm Klüwer
@johanw_gitlab

Is there a problem in the rdfs template library? Using o-rdfs:TypedResourceDescription, I see this:
[WARNING] Suspicious argument value: ottr:draft : LUB<ottr:IRI>. The value is in the ottr namespace: http://ns.ottr.xyz/0.4/

at [1: 1] (xyz.ottr.lutra.model.Template) http://tpl.ottr.xyz/rdfs/0.2/TypedResourceDescription[ ?blan ...

Johan Wilhelm Klüwer
@johanw_gitlab
The strange thing is, even with the --quiet switch, these warnings are included in the output..
(the output is otherwise ok)
Johan Wilhelm Klüwer
@johanw_gitlab
Actually, switching from version 0.2 of o-rdfs: to version 0.1 solves the problem for now.
Martin G. Skjæveland
@m.g.skjaeveland_gitlab

Is there a problem in the rdfs template library? Using o-rdfs:TypedResourceDescription, I see this:
[WARNING] Suspicious argument value: ottr:draft : LUB<ottr:IRI>. The value is in the ottr namespace: http://ns.ottr.xyz/0.4/

at [1: 1] (xyz.ottr.lutra.model.Template) http://tpl.ottr.xyz/rdfs/0.2/TypedResourceDescription[ ?blan ...

Thanks, this problem is documented here: ottr/lutra/lutra#268. We are in the process of fixing it.

The strange thing is, even with the --quiet switch, these warnings are included in the output..

This sounds like a bug, could you file it as an issue where you include the full set of CLI options used?

Johan Wilhelm Klüwer
@johanw_gitlab
I'm seeing a problem with o-owl-dec:ObjectProperty that relates to the "version 0.2" issue. This template expands to o-rdfs:TypedResourceDescription, which is in the 0.2 version (from the namespace). Does this mean o-owl-dec:ObjectProperty is currently not usable?
Johan Wilhelm Klüwer
@johanw_gitlab
Another thing. It seems there's no template for creating the inverse of an OWL property?
Martin G. Skjæveland
@m.g.skjaeveland_gitlab

I'm seeing a problem with o-owl-dec:ObjectProperty that relates to the "version 0.2" issue. This template expands to o-rdfs:TypedResourceDescription, which is in the 0.2 version (from the namespace). Does this mean o-owl-dec:ObjectProperty is currently not usable?

"Not usable" is a bit strong. It is true that o-owl-dec:ObjectProperty depends on a template (o-rdfs:TypedResourceDescription, version 0.2) that will give a WARNING (which can be safely ignored) since the template contains a ottr: vocabulary element that Lutra does not recognize. (This is caused by the fact we have introduced vocabulary elements (e.g., ottr:draft)that are not yet included in the wOTTR ontology. They are now in the development version of the vocabulary (http://dev.spec.ottr.xyz/wOTTR/) which is finally our the door due to fixed issues with the SHACL tests and CI/CD setup. The WARNING should disappear if Lutra is rebuilt. A new version of Lutra will be available shortly -- pending the merge of a MR.

Another thing. It seems there's no template for creating the inverse of an OWL property?

Yes, I think you are correct. This is not on purpose, we take no issue against inverse properties! :D Suggestions for templates are welcome.

Martin G. Skjæveland
@m.g.skjaeveland_gitlab
@johanw_gitlab , the irritating WARNING is now removed. It is available in the develop branch https://gitlab.com/ottr/lutra/lutra/-/jobs/artifacts/develop/raw/lutra.jar?job=snapshot . A new master release is pending a different issue, which has to do with releasing lutra as a maven artefact.
Martin G. Skjæveland
@m.g.skjaeveland_gitlab
Martin G. Skjæveland
@m.g.skjaeveland_gitlab

The 1st OTTR user forum will take place virtually on 2021-01-28 Thu
12:00--14:00 CET. The purpose of the event is to let users of the OTTR
framework share experiences and to meet the developers behind OTTR to
discuss future directions. The event should also be of interest to
those that are curious to see practical uses of the OTTR framework.
We also welcome input and presentations of tools and technologies that
are related to OTTR.

Preliminary agenda:

  1. OTTR team: current status and future plans
  2. Q&A
  3. Invited talk: Johan W. Klüwer
  4. Shorter talks
  5. Discussion

Register here: https://ottr.xyz/event/2021-01-28-user-forum/