Tools for Automating the Construction of an Ontology (OWL)
Project description
Ontology Builder (owl-builder)
Key Term Extraction
from owl_builder import keyterms
input_text = """
A local area network (LAN) is a computer network that interconnects computers within a limited area such as a residence, school, laboratory, university campus or office building.
By contrast, a wide area network (WAN) not only covers a larger geographic distance, but also generally involves leased telecommunication circuits.
Ethernet and Wi-Fi are the two most common technologies in use for local area networks.
Historical network technologies include ARCNET, Token Ring, and AppleTalk.
"""
results = keyterms(
input_text=input_text,
use_terms=True,
use_keyterms=True,
use_ngrams=False,
use_nounchunks=False)
The results are
[
"leased telecommunication circuit",
"historical network technology",
"large geographic distance",
"interconnects computer",
"local area network",
"university campus",
"common technology",
"wide area network",
"computer network",
"office building",
"include arcnet",
"limited area",
"token ring"
]
TTL Generation
from owl_builder import build_ttl
results = build_ttl("He has aims to make Detroit a leader in green energy.")
The result is
### http://graffl.ai/pathology#green_energy
:green_energy rdf:type owl:Class ;
rdfs:label "Green Energy" ;
rdfs:subClassOf :energy .
### http://graffl.ai/pathology#energy
:energy rdf:type owl:Class ;
rdfs:label "Energy" .
You can also supply your own taxonomy like this:
import pandas as pd
results = build_ttl(pd.DataFrame([
{"Parent": "Alpha", "Child": "Alpha Beta"},
{"Parent": "Alpha Beta", "Child": "Alpha Beta Gamma"},
{"Parent": "Gamma", "Child": "Gamma Delta"},
]))
The result is
### http://graffl.ai/pathology#alpha_beta
:alpha_beta rdf:type owl:Class ;
rdfs:label "Alpha Beta" ;
rdfs:subClassOf :alpha .
### http://graffl.ai/pathology#alpha
:alpha rdf:type owl:Class ;
rdfs:label "Alpha" .
### http://graffl.ai/pathology#alpha_beta_gamma
:alpha_beta_gamma rdf:type owl:Class ;
rdfs:label "Alpha Beta Gamma" ;
rdfs:subClassOf :alpha_beta .
### http://graffl.ai/pathology#alpha_beta
:alpha_beta rdf:type owl:Class ;
rdfs:label "Alpha Beta" .
### http://graffl.ai/pathology#gamma_delta
:gamma_delta rdf:type owl:Class ;
rdfs:label "Gamma Delta" ;
rdfs:subClassOf :gamma .
### http://graffl.ai/pathology#gamma
:gamma rdf:type owl:Class ;
rdfs:label "Gamma" .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
owl-builder-0.1.20.tar.gz
(27.6 kB
view hashes)
Built Distribution
Close
Hashes for owl_builder-0.1.20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7c1bbdc52c79e746dc1a173d8ed92fd16af98f02d44b1ea5ceaffce23e1b16 |
|
MD5 | decbb9532a13724aa3a8a5d00877bc01 |
|
BLAKE2b-256 | f38617e645bcf12c184fca9ddcfe91546d9bb5ad073654321eade47c121f3399 |