rdfio / RDFIO

RDF triples import, export and PHP SPARQL endpoint for Semantic MediaWiki
http://www.mediawiki.org/wiki/Extension:RDFIO
Other
29 stars 12 forks source link

Importing .owl.xml files using RDFIO #54

Closed thiviyanT closed 6 years ago

thiviyanT commented 6 years ago

Hello,

I am trying to import a set of ontology data into semantic mediawiki from an .owl.xml file. When I attempted to import the ontology, I am given the following error message:

Internal error
[77021c46007460f3bbb88eb9] /mediawiki/Special:RDFImport Error from line 37 of /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/extensions/Rdfio/classes/parsers/RDFIO_ARC2ToWikiConverter.php: Call to a member function getFullText() on null

Backtrace:

#0 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/extensions/Rdfio/classes/RDFIO_RDFImporter.php(77): RDFIOARC2ToWikiConverter->convert(array, array, array)
#1 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/extensions/Rdfio/classes/RDFIO_RDFImporter.php(25): RDFIORDFImporter->importFromArc2Data(array, array, array)
#2 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/extensions/Rdfio/specials/SpecialRDFImport.php(83): RDFIORDFImporter->importRdfXml(string)
#3 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/extensions/Rdfio/specials/SpecialRDFImport.php(35): RDFImport->importData(RDFIORequestData)
#4 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/includes/specialpage/SpecialPage.php(522): RDFImport->execute(NULL)
#5 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(NULL)
#6 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#7 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/includes/MediaWiki.php(862): MediaWiki->performRequest()
#8 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/includes/MediaWiki.php(523): MediaWiki->main()
#9 /Applications/mediawiki-1.29.1-0/apps/mediawiki/htdocs/index.php(43): MediaWiki->run()
#10 {main}

The error message seems to point that the parser is having trouble parsing the xml data but the details of the error is unclear to me. My ontology is in the following format - I removed some confidential data.

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
    <!ENTITY terms "http://purl.org/dc/terms/" >
    <!ENTITY foaf "http://xmlns.com/foaf/0.1/" >
    <!ENTITY bibo "http://purl.org/ontology/bibo/" >
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY swrl "http://www.w3.org/2003/11/swrl#" >
    <!ENTITY owl2 "http://www.w3.org/2006/12/owl2#" >
    <!ENTITY swrlb "http://www.w3.org/2003/11/swrlb#" >
    <!ENTITY swrlx "http://www.w3.org/2003/11/swrlx#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY event "http://purl.org/NET/c4dm/event.owl#" >
    <!ENTITY skos "http://www.w3.org/2004/02/skos/core#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>

<rdf:RDF xmlns="...#"
     xml:base="...."
     xmlns:foaf="http://xmlns.com/foaf/0.1/"
     xmlns:terms="http://purl.org/dc/terms/"
     xmlns:swrlx="http://www.w3.org/2003/11/swrlx#"
     xmlns:owl2="http://www.w3.org/2006/12/owl2#"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:swrl="http://www.w3.org/2003/11/swrl#"
     xmlns:swrlb="http://www.w3.org/2003/11/swrlb#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:BiboExtension=".....#"
     xmlns:skos="http://www.w3.org/2004/02/skos/core#">

    <owl:NamedIndividual rdf:about="....#....">
        <rdf:type rdf:resource=".....#Topic"/>
        <skos:broaderGeneric rdf:resource="...#some_arbitary_topic"/>
    </owl:NamedIndividual>

    ....

</rdf:RDF> 

I would also like to preview the structure of the wiki pages and, if possible edit the structure, before importing the ontology data. This is discussed briefly in the paper by @samuell's group states on page 3, but I cannot find the option to do this in SMW.

Thanks.


List of tools that I am using:

samuell commented 6 years ago

Hi @ThiviyanThanapalasingam !

Aha. Note that RDFIO is unfortunately not really supporting OWL ontology import so far, but is instead focussing on plain RDF triples.

For ontology import, you might want to look at something like Fresnel Forms, which we also mention in the paper. Fresnel Forms is created specifically for automatically setting up ontologies in the wiki, and allows you to design your page structure as an ontology in Protege before pushing it into the wiki.

It was recently presented by Lloyd Rutledge at SMWCon.

Hope this helps!

thiviyanT commented 6 years ago

Hi @samuell,

Thank you again! Nevertheless, I find that RDFIO is a valuable tool for me.

Regarding the ontology import, I followed the installation guide for Fresnel Forms as described here. It is unclear to me how to acquire the Fresnel Forms .jar file for the last step. If you did do the installed the plugin before, could you please let me know where I can get the .jar file from? I do realise that this is the wrong thread to ask this question, but it seems that the discussion/issue page for Fresnel Forms has not been in use for a long time.

thiviyanT commented 6 years ago

Never mind, I have found it. Thank you @samuell.

samuell commented 6 years ago

Thanks for the ecouragement @ThiviyanThanapalasingam , it is appreciated! :)