{"id":20188637,"url":"https://github.com/der3318/ontology-acquisition","last_synced_at":"2026-05-13T09:02:31.402Z","repository":{"id":92549091,"uuid":"65889749","full_name":"der3318/ontology-acquisition","owner":"der3318","description":"An Ontology Acquisition Tool with GUI","archived":false,"fork":false,"pushed_at":"2016-08-31T02:29:10.000Z","size":6943,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-30T18:16:43.726Z","etag":null,"topics":["automation","ontology","swing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/der3318.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-17T08:23:28.000Z","updated_at":"2021-06-20T07:57:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4d29410-1198-4302-a702-548a9cb74975","html_url":"https://github.com/der3318/ontology-acquisition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/der3318/ontology-acquisition","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fontology-acquisition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fontology-acquisition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fontology-acquisition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fontology-acquisition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/der3318","download_url":"https://codeload.github.com/der3318/ontology-acquisition/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fontology-acquisition/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32975183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T06:31:55.726Z","status":"ssl_error","status_checked_at":"2026-05-13T06:31:51.336Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","ontology","swing"],"created_at":"2024-11-14T03:30:00.289Z","updated_at":"2026-05-13T09:02:31.379Z","avatar_url":"https://github.com/der3318.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## **Java - Chinese Ontology Library API**\n#### **Prerequisite**\n* JavaSE-1.7\n* UTF-8 File Encoding\n\n\n#### **EHowNet**\n###### Load EHowNet Library and EHowNet Ontology\n* Add `ontologyAcquisition.jar` to classpath\n* Get an instance of the Ontology file `ehownet_ontology.txt`\n\n\t```java\n    EHowNetTree tree = EHowNetTree.getInstance(\"./docs/ehownet_ontology.txt\");\n    ```\n\n\n###### Search\n* For example, we search for �u�}�ߡv\n\n\t```java\n    List\u003cEHowNetNode\u003e results = tree.searchWord(\"�}��\");\n    EHowNetNode node = results.get(0);\n    ```\n\n* If there's no result, an empty List will be returned\n\n\n###### Data within a Node\n* `node.getNodeType()`: return `NodeType.WORD` or `NodeType.TAXONOMY`\n    * Node with type `NodeType.WORD` has no Hyponym, since it is at the bottom of the Ontology\n* For word node:\n    * `node.getSid()`:  return an integer denoting the id of the word, for example `61549`\n    * `node.getNodeName()`: return a string denoting the name of the word, for example `�}��`\n    * `node.getPos()`: return a string denoting the part-of-speech tag of the word, for example `Nv4,VH21`\n    * `node.getEhownet()`: return a string denoting the ehownet's definition of the word, for example `{joyful|�߮�}`\n* For taxonomy node:\n    * `node.getNodeName()`: return a string denoting the name of the taxonomy, for example `����`\n    * `node.getEhownet()`: return a string denoting the ehownet's definition of the word, for example `object|����`\n\n\n###### Hypernym\n* `node.getHypernym()`: return an `EHowNetNode` instance, which is the parent of the node. If the node is at the top of the Ontology, the returned value will be `null`\n\n\n###### Hyponym\n* `node.getHyponymList()`: return a `List\u003cEHowNetNode\u003e` instance, containing all the children of the node. If the node is at the bottom of the Ontology, an empty List will be returned\n\n\n#### **CKIP Document Converter**\n###### Convert a Text File into CKIP-Tagged Document\n* Add `ontologyAcquisition.jar` and `jsoup-1.9.2.jar` to classpath\n* Set the input/output files and convert\n\n\t```java\n    Converter.toCKIP(\"ckip_input.txt\", \"ckip_output.txt\");\n    ```\n\n* We can also convert the documents online: http://sunlight.iis.sinica.edu.tw/uwextract/demo.htm\n\n\n#### **Ontology Acquisition**\n###### Load the Acquisition Tools\n* Add `ontologyAcquisition.jar` and `jxl.jar` to classpath\n* Initialize and start with root concept, CKIP-documents and EHowNet\n\n\t```java\n    OntologyAcquisition oa = new OntologyAcquisition(\"�Һ�\", \"./docs/ckip\", \"./docs/ehownet_ontology.txt\");\n    oa.start();\n    ```\n\n\n###### Search for a Specific Concept\n* For example, we search for �u�|ĳ�v\n\n\t```java\n    OntologyNode node = oa.searchConcept(\"�|ĳ\");\n    ```\n\n* If the concept does not exist, `null` will be returned\n\n\n###### Data within a Node\n* `node.getConcept()`: return a string denoting the name of the concept, for example `�|ĳ` and `�O��`\n* `node.getAttr()`: return a `List\u003cString\u003e` instance, containing all the related concept(but not Hypernym or Hyponym) of the node. If the node has no attributes, an empty List will be returned\n\n\n###### Hypernym\n* `node.getHypernym()`: return an `OntologyNode` instance, which is the parent of the node. If the node is at the top of the Ontology, the returned value will be `null`\n\n\n###### Hyponym\n* `node.getCategories()`: return a `List\u003cOntologyNode\u003e` instance, containing all the children of the node. If the node is at the bottom of the Ontology, an empty List will be returned\n\n\n###### Term/Document Frequency\n* `oa.getTermFreq(\"�Ш|\")`: return an integer, which is the term frequency of `�Ш|`\n* `oa.getDocFreq(\"�Ш|\")`: return an integer, which is the document frequency of `�Ш|`\n\n\n###### Save the Ontology\n* `oa.dump()`: save the Ontology into a new sheet in `result.xls`\n\n\n###### UI Version\n* `new UIFrame()`\n\n![Imgur](http://i.imgur.com/x7W2MpI.jpg)\n\n\n#### **Ontology Doc2Vec**\n###### Load the Tools and Build the Model\n* Add `ontologyAcquisition.jar` to classpath\n* Build the model with domain concept, CKIP-documents, EHowNet and dimension of the output vector\n\n    ```java\n    Doc2Vec d2v = new Doc2Vec(\"�Һ�\", \"./docs/ckip\", \"./docs/ehownet_ontology.txt\", 5);\n    VectorModel model = d2v.build();\n    ```\n\n\n###### Features and Valid Dimension\n* `model.getFeatures()`: return a `List\u003cString\u003e` instance, denoting the features extraced by the model. An empty list will be returned if the process fails\n* `model.getDimension()`: return an integer equal to the valid dimension\n\n\n###### Vectors\n* `model.getDocVectors()`: return a `Map\u003c String, List\u003cDouble\u003e \u003e` instance containing all the document vectors. `key` is the absolute path of a document while `value` is the vector\n* `model.getDocVector(\"docs/ckip/97815.txt\")`: return a `List\u003cDouble\u003e` instance denoting the vector of the document with path `docs/ckip/97815.txt`. Both path and absolute path are acceptable for the parameter\n\n\n#### **Compile and Run the Sample Project**\n* `OntologyDemo` is an Eclipse sample project of EHowNet, CKIP-Converter, Ontology Acquisition and Doc2Vec\n* For Eclipse:\n    * Open the project in workspace\n    * `Properties-JavaBuildPath-Libraries`: add all the JAR files in `libs`\n    * `Windows-Perferences-General-Workspace`: set the text file encoding to `UTF-8`\n* For Shell:\n    * `Makefile` is available\n        * `OntologyDemo$ make` to compile, `OntologyDemo$ make run` to run\n    * Commands to Compile and Run\n\n        ```\n        OntologyDemo$ javac -d bin -sourcepath src -encoding utf8 -cp libs/jsoup-1.9.2.jar;libs/jxl.jar;libs/ontologyAcquisition.jar src/Main.java\n        \n        OntologyDemo$ java -Dfile.encoding=UTF-8 -cp bin;libs/jsoup-1.9.2.jar;libs/jxl.jar;libs/ontologyAcquisition.jar Main\n        ```\n\n\n#### **Reference**\n* [JExcel](http://jexcelapi.sourceforge.net/)\n* [JSoup](https://jsoup.org/)\n* [CKIP Service](http://ckipsvr.iis.sinica.edu.tw/)\n* [EHowNet](http://ehownet.iis.sinica.edu.tw/index.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fder3318%2Fontology-acquisition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fder3318%2Fontology-acquisition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fder3318%2Fontology-acquisition/lists"}