srdc / ontmalizer Goto Github PK
View Code? Open in Web Editor NEWA tool that performs comprehensive transformations of XML Schemas (XSD) and XML data to RDF/OWL automatically
License: Other
A tool that performs comprehensive transformations of XML Schemas (XSD) and XML data to RDF/OWL automatically
License: Other
My source XML Schema has enumerations, which are correctly parsed by Ontmalizer. However, within each of my enumerations is documentation. It looks like this:
<xs:simpleType name="issuesYears">
<xs:restriction base="xs:unsignedInt">
<xs:enumeration value="1">
<xs:annotation>
<xs:documentation xml:lang="en">Less than one year</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="2">
<xs:annotation>
<xs:documentation xml:lang="en">1 to 2 years</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3">
<xs:annotation>
<xs:documentation xml:lang="en">3 to 5 or more years</xs:documentation>
</xs:annotation>
</xs:enumeration>
And the resulting OWL is:
:issuesYears_Enumeration rdf:type owl:NamedIndividual ,
dtype:Enumeration ;
dtype:hasValue :issuesYears_1 ,
:issuesYears_2 ,
:issuesYears_3 .
It would be great if Ontmalizer picked up these changes, and added the documentation to describe the enumeration values.
Hi,
I need to implement conversion from RDF message to XML according to a specific xml schema in order to be compliant with legacy system.
Are you working also on the implementation of lowering conversion process?
Let me know, please
Thanks so much for your contribution.
G
Hi,
I'm using this tool to generate the OWL schema from HL7 CDA Release 2 XSD specs got from http://www.hl7.org/implement/standards/product_brief.cfm?product_id=7
I got the OWL using XSD2OWLMapper, but neither Protégè nor Pellet can read the ontology and both reply with: "values element 0 cannot be null".
This looks like an issue in the OWL file, and then in ontmalizer I guess.
Please ask if you need more info.
How do I use this tool from the command line or is a plugin for a framework? Protege, Eclipse?
This is on 64bit Ubuntu 14.04 LTS.
It appears to have built okay.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:15.255s
[INFO] Finished at: Fri Aug 22 14:44:31 BRT 2014
[INFO] Final Memory: 18M/98M
[INFO] ------------------------------------------------------------------------
Making it executable and then running:
$ ./ontmalizer-1.0.0.jar mlhim244.xsd
where mlhim244.xsd is the schema to translate, yields this output:
./ontmalizer-1.0.0.jar: line 1: $'PK\003\004': command not found
./ontmalizer-1.0.0.jar: line 2: $'\217u\026E': command not found
./ontmalizer-1.0.0.jar: line 3: $'\023\313R\363x\271\234J3sJ\300\342%\231\271\020n\212\256WJ6\310ls=\203x3S^.^.PK\003\004': command not found
K-_��ϳR0�3��r,J��,K-��V��+����R�KRSt�_���ETA-INF/MANIFEST.MF�M��LK-.
��3R�: No such file or directory
./ontmalizer-1.0.0.jar: line 4: {u�E�tr/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 5: {u�Etr/com/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 6: {u�E
tr/com/srdc/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 7: {u�E�tr/com/srdc/ontmalizer/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 8: {u�E�tr/com/srdc/ontmalizer/data/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 9: {u�E�tr/com/srdc/ontmalizer/helper/PK��: No such file or directory
./ontmalizer-1.0.0.jar: line 10: syntax error near unexpected token `$'\241\005Z''
./ontmalizer-1.0.0.jar: line 10: {u�E�aZ�����/tr/com/srdc/ontmalizer/data/TypedResource.class��MO�@���͇��(�Z>E�P�.E�"�!5����#�F�R S�TT�?'
Thoughts? Help?
Thanks.
Hi Mustafa,
So I have an outstanding pull request - it's nothing major, just a minor addition to allow loading XSDs from resources on the classpath (e.g. XSD files bundled as resources in JARs on the classpath).
But if you merge that pull request, would you consider bumping the version number of Ontmalizer and also releasing to Maven Central from now on? That would make it super-easy for us here to pick up the latest pull-request changes, while also making further updates much easier to consume (i.e. we'd just need to bump the dependency version in our project POMs (which of course point to Maven Central), and everything else would 'just work').
Cheers,
Pat.
I have an XSD schema file that imports types from a different namespace. It seems like Ontmalizer ignores import statements: if I save the model as TTL, there's no mention of the elements with the imported types, and when I try to load a document, it fails.
Are imports supposed to work, or is this a known limitation?
The broken link is within the sentence:
Please` refer to our blog post (http://www.srdc.com.tr/projects/salus/blog/?p=189) for further details.
.
When trying to map a specific xsd file I got an exception which I can not solve.
Exception in thread "main" java.lang.InternalError: unresolved reference at com.sun.xml.xsom.impl.parser.DelayedRef._get(DelayedRef.java:103) at com.sun.xml.xsom.impl.parser.DelayedRef$Element.get(DelayedRef.java:199) at com.sun.xml.xsom.impl.ElementDecl.getSubstAffiliation(ElementDecl.java:115) at com.sun.xml.xsom.impl.ElementDecl.updateSubstitutabilityMap(ElementDecl.java:179) at com.sun.xml.xsom.impl.parser.ParserContext.getResult(ParserContext.java:141) at com.sun.xml.xsom.parser.XSOMParser.getResult(XSOMParser.java:214) at tr.com.srdc.ontmalizer.XSD2OWLMapper.parseXSD(XSD2OWLMapper.java:128) at tr.com.srdc.ontmalizer.XSD2OWLMapper.<init>(XSD2OWLMapper.java:96) at test.main(test.java:13)
the xsd file is quite big and includes some import. I can share it in case it is required.
Any help would be much appreciated.
Hi, I'm trying to convert a schema using your tool, but i meet some issues and I can't clarify them. As an input I use the official PLCopen (Industry description language - http://www.plcopen.org/pages/tc6_xml/) XSD file and when I check the ontology output it is not consistent and i get some Anonymous classes. I'm attaching both files (input and output) for reference. When I load the ontology in Protege I get also many errors(screenshot attached). I will be grateful if you give me some hints.
files.zip
Build from latest in github and testing with a simple schema and conforming XML instance and using example code from the blog post (Ontmalizer...).
I am able to map the schema and then when trying to map instance document, non-deterministically, sometimes a reasonable n3 file is generated and sometimes XML2OWLMapper throws an exception when traversing one of the attributes in the first child element of the instance document.
Repeated trials with the same XMLSchema and sample instance documents sometimes fail and sometimes not, and when there is an exception it is not always at the same attribute - I put Logger calls in XML2OWLMapper on calls to traverseChildren and in traverseAttributes. Here is the exception that is thrown (the stacktrace is below):
Exception in thread "main" org.apache.jena.ontology.ConversionException: Cannot convert node http://www.srdc.com.tr/ontmalizer#hasValue to OntProperty
The exception, when it occurs, does not occur on the same attribute but always on some attribute of the first child element of the instance document.
The java test, a sample run, schema and instance file are attached as ontmalizer-nd-issue.zip
Hi,
A question, I want to transform an xml file to owl, but when for example I put these lines of code:
XSD2OWLMapper mapping = new XSD2OWLMapper(new File("C:/Users/usuario/Desktop/report1.xsd"));
mapping.setObjectPropPrefix("");
mapping.setDataTypePropPrefix("");
mapping.convertXSD2OWL();
// This part converts XML instance to RDF data model.
XML2OWLMapper generator = new XML2OWLMapper(
new File("C:/Users/usuario/Desktop/report.xml"), mapping);
generator.convertXML2OWL();
// This part prints the RDF data model to the specified file.
try{
File f = new File("C:/Users/usuario/Desktop/report1.n3");
f.getParentFile().mkdirs();
FileOutputStream fout = new FileOutputStream(f);
generator.writeModel(fout, "N3");
fout.close();
} catch (Exception e){
e.printStackTrace();
}
I have this error:
3050 [main] WARN org.apache.jena.rdf.model.impl.RDFDefaultErrorHandler - unknown-source: {W136} Relative URIs are not permitted in RDF: specifically <ont-policy.rdf>
These are the files I'm using
I do not know why, please help. I will be grateful if you give me some hints.
Hi there,
Im trying to find the mapping rules you used to convert from XSD to OWL but the link in description is not working anymore (http://blog.salusproject.eu/?p=189.), is there a new site with this information?
Thanks in advance
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.