Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage Question #3

Open
twcook opened this issue Aug 22, 2014 · 4 comments
Open

Usage Question #3

twcook opened this issue Aug 22, 2014 · 4 comments

Comments

@twcook
Copy link

twcook commented Aug 22, 2014

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.

@msfyuksel
Copy link
Member

Hi Tim,

It is normal to get those exceptions as we do not build an executable jar for ontmalizer, but I'll keep this in mind for future updates. Ontmalizer is not a plugin either. It is indeed an open source library for XSD and XML to RDF/OWL conversion.

You can either import the outcome jar into your own java project, or import the ontmalizer code base to your favourite java IDE (e.g. Eclipse) to play with it.

In the main github page of ontmalizer (https://github.com/srdc/ontmalizer), I already provide sample java routines for XSD to RDF/OWL and XML to RDF/OWL conversion. They are also available in the test classes located at https://github.com/srdc/ontmalizer/tree/master/src/test/java/eu/salusproject/tr/com/srdc/ontmalizer.

You can just copy those code snippets to your own class and replace sample test XSDs and XML instances with your own XSDs and XMLs. To be more precise, for XSD conversion, just update the following lines:

// input
XSD2OWLMapper mapping = new XSD2OWLMapper(new File("src/test/resources/test/test.xsd"));

and

// output
File f = new File("src/test/resources/output/test.n3");

I hope it is clear now.

Mustafa

@twcook
Copy link
Author

twcook commented Aug 23, 2014

Yes, that confirms my suspicion. :-) I would certainly like to see a command line wrapper included for those of us that are not Java developers. But, thanks for publishing under an open license. Maybe someone will contribute a wrapper.

@eliohb
Copy link

eliohb commented Feb 19, 2019

Hello i installed the project and i have run the command mvn install and it was successful. How can i use the project? using a command line or in java or any by editing the file .class to change the path.
Can you explain more

@IpekUyguner
Copy link

Hello,
can I use ontmalizer for any XML file? Don't I also need to give semantic mapping rules as input? I am new at this topic, thus I am liitle confused. When I searched for from XML to Ontology, it always says that
I need to write mapping rules for each XML. But for this project, it seems the only input is XML file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants