kasei / attean

A Perl Semantic Web Framework
19 stars 10 forks source link

RDF to OWL 2 Mapping #161

Open wbraswell opened 1 year ago

wbraswell commented 1 year ago

Hello @kasei ! My team is interested in potentially using Attean as part of our ongoing OWL 2 project. We are currently considering our options for implementing an OWL 2 API in Perl.

One of the to-be-implemented components is the logical mapping between RDF and OWL 2, as specified by W3C: https://www.w3.org/TR/owl2-mapping-to-rdf/

Have you or any of the other Attean developers already started work on this RDF-to-OWL2 mapping?

kasei commented 1 year ago

Hi @wbraswell. There's never been much activity or developer capacity for doing reasoning work within the perlrdf project. Sounds interesting, but I don't think anyone has done any work in that area to this point.

kjetilk commented 1 year ago

I'm not aware of any either. There was some old code kicking around from a hackathon way back, but it would probably not be aligned with Attean.

Since reasoning is fairly heavy, my assumption is that much of it should be written in a lower-level language, e.g. C with a XS bridge to Perl. I suppose this could be tied into existing C/C++ based systems, but I haven't been enough in that community to know if I'm completely outdated, but back in my day, things like Fact++ had OWL API implementation, right?

I think it would be very interesting to see the flexibility of Attean put to good use with an XS-based integration with C/C++ frameworks, where we also ended up exposing an OWL API.

wbraswell commented 1 year ago

Howdy @kasei & @kjetilk, thanks for the replies!

We have decided to begin plans for implementing a Perl API to the Cowl library: https://github.com/sisinflab-swot/cowl

(We are interested in reasoning, but not until after we have fully completed the Cowl API, so that should be kept as a separate conversation.)

As part of this overall project, we are considering the value of implementing the RDF-to-OWL mapping as part of the Attean or AtteanX namespaces. Does this seem correct and reasonable?

wbraswell commented 1 year ago

@kasei Does Attean already have an RDF-to-Perl mapping implemented, and if so can you please send a link to the corresponding source code files?

kasei commented 1 year ago

@wbraswell – Can you expand on what you mean by "RDF-to-Perl mapping"? Do you mean something like an RDF version of ORM?

wbraswell commented 1 year ago

@kasei Let me get back to you on the "RDF-to-Perl mapping" thing, I'll have to get a bit farther along.

Meanwhile, our current plan is to create the first 3 components:

  1. Perl API to Cowl C library (https://github.com/sisinflab-swot/cowl)
  2. Any AtteanX extensions required to fully interface between the Perl Cowl API and existing Attean Perl code
  3. Perl ORM-like "ontology-oriented programming" interface on top of Perl Cowl API (similar to Owl Ready 2 in Python)

I will be in touch as we move forward, especially surrounding the AtteanX components. Thanks for your support so far!

wbraswell commented 1 year ago

@kasei We have been talking to Jean-Baptiste Lamy (AKA "Jiba"), the creator of the Owlready software in Python. Owlready uses the SQLite3 database with an "RDF quadstore" schema as the underlying storage format. This "facilitates the loading of RDF/XML file[s] ... [and] implement[ing] SPARQL queries." In the same vein, can you please point me to the Attean documentation (or simply provide an explanation) of what Attean uses for the underlying data storage format?

kjetilk commented 1 year ago

In the same vein, can you please point me to the Attean documentation (or simply provide an explanation) of what Attean uses for the underlying data storage format?

I can help with that :-) Basically, Attean has a top-level abstraction in the form of Model, and given that you want quad semantics, you would implement using Attean::QuadModel.

Below Model there is a Store API, where there are several implementations, so Attean doesn't have one underlying storage format, it takes whatever is implemented as a Store, and there are a few.

There is also a AtteanX::Store::DBI implementation, which can use DBD::SQlite for a SQLite3 database, if that's what you want.

wbraswell commented 1 year ago

@kjetilk Wow that's great, excellent work on all the different Attean back-ends! We are not yet sure exactly which of these we will utilize, so I will probably have some more questions about design and implementation details in the near future. Thanks!