{"id":27266217,"url":"https://github.com/sszuev/ont-converter","last_synced_at":"2025-07-28T18:07:47.387Z","repository":{"id":37744917,"uuid":"118141450","full_name":"sszuev/ont-converter","owner":"sszuev","description":"A jvm tool to convert any rdf-ontology to owl2-ontology","archived":false,"fork":false,"pushed_at":"2023-03-12T07:33:36.000Z","size":238,"stargazers_count":23,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"v2","last_synced_at":"2025-05-30T20:46:31.512Z","etag":null,"topics":["apache-jena","converter","ont-api","ontapi","ontology","owl-api","owl2","rdf","semantic-web","tool"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sszuev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-19T15:21:12.000Z","updated_at":"2024-06-19T05:11:32.000Z","dependencies_parsed_at":"2024-01-07T22:14:36.421Z","dependency_job_id":"e84c39b7-64e7-4b2d-a7fb-23bc6bfb13a5","html_url":"https://github.com/sszuev/ont-converter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/sszuev/ont-converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sszuev%2Font-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sszuev%2Font-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sszuev%2Font-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sszuev%2Font-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sszuev","download_url":"https://codeload.github.com/sszuev/ont-converter/tar.gz/refs/heads/v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sszuev%2Font-converter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261682995,"owners_count":23193686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-jena","converter","ont-api","ontapi","ontology","owl-api","owl2","rdf","semantic-web","tool"],"created_at":"2025-04-11T08:44:37.011Z","updated_at":"2025-06-24T13:11:50.295Z","avatar_url":"https://github.com/sszuev.png","language":"Kotlin","funding_links":[],"categories":["Tools"],"sub_categories":["BBedit"],"readme":"# Ontology Converter v2.0\n\n## A simple command-line utility to convert any RDF graph to OWL2-DL ontology.\n\nThis is a kind of [ONT-API](https://github.com/owlcs/ont-api) extension.\nCan work both with single ontology file source and with directory containing dependent or independent ontology document sources.\nThe utility automatically transforms the source RDF Graph to the OWL2 DL syntax according to the internal rules and command-line options.\nFor example, if there is no `owl:Ontology` section inside rdf-graph (which is required by OWL), an anonymous ontology header will be generated.\nThe tool is available in the form of code and prebuilt jar (see [/releases](https://github.com/sszuev/ont-converter/releases)), \nand as a library at [jitpack.io](https://jitpack.io).\n\n### Usage: `java -jar ont-converter.jar [-f] [-h] -i \u003cpath\u003e [-if \u003cformat\u003e] -o \u003cpath\u003e -of \u003cformat\u003e [-p \u003c0|1|2\u003e] [-r] [-v] [-w]`\n\n### Options:\n\n* **-f,--force**                     `Ignore any exceptions while loading/saving and processing imports.`\n* **-i,--input \u003cpath\u003e**              `The file path or not-empty directory to load ontology/ontologies. (always required) { String }`\n* **-if,--input-format \u003cformat\u003e**    `The input format. If not specified the program will choose the most suitable one to load ontology from a file. { Value should be one of [{0, ttl, TURTLE}, {1, rdf, RDF_XML, RDF/XML}, {2, rj, RDF_JSON, RDF/JSON}, {3, jsonld, JSON_LD, JSON-LD}, {4, nt, NTRIPLES, N-Triples}, {5, nq, NQUADS, N-Quads}, {6, trig}, {7, trix}, {8, trdf, RDF_THRIFT, RDF-THRIFT}, {11, owl, OWL_XML, OWL/XML}, {12, omn, MANCHESTER_SYNTAX, ManchesterSyntax}, {13, fss, FUNCTIONAL_SYNTAX, FunctionalSyntax}, {18, krss2}, {19, dl}] }`\n* **-o,--output \u003cpath\u003e**             `The file or directory path to store result ontology/ontologies.If the --input is a file then this parameter must also be a file. (always required) { String }`\n* **-of,--output-format \u003cformat\u003e**   `The format of output ontology/ontologies. (always required) { Value should be one of [{0, ttl, TURTLE}, {1, rdf, RDF_XML, RDF/XML}, {2, rj, RDF_JSON, RDF/JSON}, {3, jsonld, JSON_LD, JSON-LD}, {4, nt, NTRIPLES, N-Triples}, {5, nq, NQUADS, N-Quads}, {6, trig}, {7, trix}, {8, trdf, RDF_THRIFT, RDF-THRIFT}, {11, owl, OWL_XML, OWL/XML}, {12, omn, MANCHESTER_SYNTAX, ManchesterSyntax}, {13, fss, FUNCTIONAL_SYNTAX, FunctionalSyntax}, {18, krss2}, {19, dl}, {20, html, DL_HTML, DL/HTML}, {21, tex, LATEX}] }`\n* **-p,--punnings \u003cmode\u003e**           `The punning mode. Could be used in conjunction with --refine option. Must be one of the following:Lax mode: allows any punnings, i.e. ontology is allowed to contain multiple entity declarationsMiddle mode: two forbidden intersections: Datatype \u003c-\u003e Class \u0026 NamedObjectProperty \u003c-\u003e DatatypePropertyStrict mode: all punnings are forbidden, i.e. Datatype \u003c-\u003e Class and rdf:Property intersections(any pairs of NamedObjectProperty, DatatypeProperty, AnnotationProperty). { Value should be one of [{0, STRICT}, {1, MEDIUM}, {2, LAX}] }`\n* **-r,--refine**                    `Refine output: if specified the resulting ontologies will consist only of the OWL2-DL components (annotations and axioms), otherwise there could be some rdf-stuff (in case the output format is provided by jena)`\n* **-v,--verbose**                   `To print progress messages to console.`\n* **-w,--web**                       `Allow web/ftp diving to retrieve dependent ontologies from imports (owl:imports),otherwise the specified directory (see --input) will be used as the only source.`\n\n### Example (RDF/XML -\u003e Manchester Syntax):\n\n`$ java -jar ont-converter.jar -i /tmp/pizza.owl.xml -if 1 -o /tmp/pizza.omn -of 12 -v`\n\nwhere\n* `-i /tmp/pizza.owl.xml` - the path to existing source file, required. In the example above it is [pizza.owl](https://protege.stanford.edu/ontologies/pizza/pizza.owl).\n* `-if 1` - the explicit input format (could be also `-if rdf`, `-if rdf/xml` or `-if rdf_xml`), optional.\n* `-o /tmp/pizza.omn` - the path to target file, required.\n* `-of 12` - the output format (could be also `-of omn`, `-of manchestersyntax`, `-of manchester_syntax`), required.\n* `-v` - to print progress info to console, optional.\n\n### Load API\nSome facilities from the tool internals can be used as a library to simplify bulk loading. \nThis can be helpful to properly handle all `owl:imports` dependencies. See examples:\n```java\nimport com.github.owlcs.ontapi.OntFormat;\nimport com.github.sszuev.ontconverter.api.LoadersKt;\nimport com.github.sszuev.ontconverter.api.ManagersKt;\nimport com.github.sszuev.ontconverter.api.OntologyMap;\n\nList\u003cOntologyMap\u003e maps = LoadersKt.loadDirectory(Path.of(\"/path-to-dir-with-ontologies\"), null, false, ManagersKt::createSoftManager);\nmaps.forEach(map -\u003e map.getIds().forEach((iri, id) -\u003e System.out.println(\"document-iri = \" + iri + \" =\u003e id=\" + id)));\nmaps.forEach(map -\u003e map.getGraphs().forEach((iri, g) -\u003e System.out.println(\"document-iri = \" + iri + \" =\u003e triples=\" + g.size())));\nmaps.forEach(map -\u003e map.sources().iterator().forEachRemaining(s -\u003e System.out.println(\"document-source = \" + s)));\n\nOntologyMap map = LoadersKt.loadFile(Path.of(\"/path-to-file-ttl\"), OntFormat.TURTLE, false, ManagersKt.createSoftManager());\nSystem.out.println(map);\n```\n### Requirements:\n* **java-11+** tp tun\n* **[gradle-7+](https://gradle.org/)** to build\n\n### Build:\n- To build use `gradle clean build` running in the project root.\n- To install into local maven repository (`.m2`) use `gradle publishToMavenLocal`\n- To run from the project root use command `java -jar build/libs/ont-converter.jar`\n\n### Issues:\nPlease use [/ont-converter/issues](https://github.com/sszuev/ont-converter/issues) page\n\n### Dependencies:\n[ONT-API](https://github.com/owlcs/ont-api) (__version 3.0.0__)\n\n### Full list of supported formats:\n| Name | Provider | Read / Write | Aliases (case insensitive) |\n| :-------------  | :------------- | :-------------| :----- |\n| TURTLE | Apache Jena | yes / yes | 0, turtle, ttl |\n| RDF_XML | Apache Jena | yes / yes | 1, rdf_xml, rdf/xml, rdf |\n| RDF_JSON | Apache Jena | yes / yes | 2, rdf_json, rdf/json, rj |\n| JSON_LD | Apache Jena | yes / yes | 3, json_ld, json-ld, jsonld |\n| NTRIPLES | Apache Jena | yes / yes | 4, ntriples, n-triples, nt |\n| NQUADS | Apache Jena | yes / yes | 5, nquads, n-quads, nq |\n| TRIG | Apache Jena | yes / yes | 6, trig |\n| TRIX | Apache Jena | yes / yes | 7, trix |\n| RDF_THRIFT | Apache Jena | yes / yes | 8, rdf_thrift, rdf-thrift, trdf |\n| OWL_XML | OWL-API | yes / yes | 11, owl_xml, owl/xml, owl |\n| MANCHESTER_SYNTAX | OWL-API | yes / yes | 12, manchester_syntax, manchestersyntax, omn |\n| FUNCTIONAL_SYNTAX | OWL-API | yes / yes | 13, functional_syntax, functionalsyntax, fss |\n| BINARY_RDF | OWL-API | yes / yes | 14, binary_rdf, binaryrdf, brf |\n| RDFA | OWL-API | yes / no | 15, rdfa, xhtml |\n| OBO | OWL-API | yes / yes | 16, obo |\n| KRSS2 | OWL-API | yes / yes | 18, krss2 |\n| DL | OWL-API | yes / yes | 19, dl |\n| DL_HTML | OWL-API | no / yes | 20, dl_html, dl/html, html |\n| LATEX | OWL-API | no / yes | 21, latex, tex |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsszuev%2Font-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsszuev%2Font-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsszuev%2Font-converter/lists"}