ontology-of-electronics / OOE

Ontology of Electronics
2 stars 0 forks source link

A start? #1

Closed kasbah closed 6 years ago

kasbah commented 6 years ago

I made a start at trying to understand how this would work. From within Jesper's EMMO fork I created:

import emmo
import owlready2

emmoOntology = emmo.get_ontology('emmo-0.3_2017-10-26.owl')
emmoOntology.load()

# not sure why it isn't easier to get the 'component' entity
component = emmoOntology.search(iri='*EMMO_000168')[0]

onto = owlready2.get_ontology('https://ontology-of-electonics.github.io')

class ElectronicComponent(component):
    namespace = onto

class PassiveComponent(ElectronicComponent):
    namespace = onto

class Capacitor(PassiveComponent):
    namespace = onto

class Resistor(PassiveComponent):
    namespace = onto

onto.save(file='electronics.owl', format='rdfxml')

Which writes:

<?xml version="1.0"?>
<rdf:RDF xml:base="https://ontology-of-electonics.github.io"
         xmlns="https://ontology-of-electonics.github.io#"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
         xmlns:owl="http://www.w3.org/2002/07/owl#">

<owl:Ontology rdf:about="https://ontology-of-electonics.github.io"/>

<owl:Class rdf:about="#ElectronicComponent">
  <rdfs:subClassOf rdf:resource="https://emmc.info/emmo#EMMO_000168"/>
</owl:Class>

<owl:Class rdf:about="#PassiveComponent">
  <rdfs:subClassOf rdf:resource="#ElectronicComponent"/>
</owl:Class>

<owl:Class rdf:about="#Capacitor">
  <rdfs:subClassOf rdf:resource="#PassiveComponent"/>
</owl:Class>

<owl:Class rdf:about="#Resistor">
  <rdfs:subClassOf rdf:resource="#PassiveComponent"/>
</owl:Class>

</rdf:RDF>

Some notes:

dvc94ch commented 6 years ago

I think it's probably a component from our perspective and a system from the manufacturers perspective.

The bfo differentiates between universals and defined classes. We can have a defined class called RealElectronicComponent that contains all ElectronicComponents with a Package association. This would allow us to model a pcb stackup as a ec and a resistor array as a ec.

kasbah commented 6 years ago

Ok, kind of makes sense. Calling something Real* seems kind of confusing (the other one is not real?) but I think with this stuff it's easy to just run out of names so there may not be anything better (Physical, Discreet?). Closing this as I've seen you put this into the repo.

dvc94ch commented 6 years ago

I think we shouldn't use PassiveComponent as a class. According to wikipedia Passivity is used very informally. According to the closest formal definition (incremental passivity): An ElectricalComponent that is incapable of power gain includes the diode as a passive element.

[0] https://en.wikipedia.org/wiki/Passivity_(engineering)

The other issue is that of it not being disjoint with another possible top level class like electromechanicalcomponent. Based on that definition an electromechanical component would also be passive.

kasbah commented 6 years ago

Ok, but pretty much all retailers, part search engines and EDA libraries agree on the category of passive components so it still seems useful. What would you propose instead?

I feel like we will keep running into issues like this and there just isn't a correct way to categorize things. I am very interested in agreeing on a practical taxonomy for purchasable electronic components. Once we have that it'd be interesting to explore how to align that with an ontology of electrical properties of other things and to try and fit it into the greater ontologies (although I don't have an immediate practical use for it). First and foremost I want a taxonomy of parts that will be familiar to the average electronic engineer.

dvc94ch commented 6 years ago

Is there any use case where it is important to distinguish between passive and active components? I propose making Resistor a subclass of ElectronicComponent. See my pushed changes, where I fleshed out the Resistor classes. What do you think?

Could also be made a defined class, so we say all Resistor, Capacitor, Inductor, Fuse... are Passive without making Passive a universal (part of the taxonomy)

FIY: Keep in mind I'm new to ontology =P But from what I understand a universal needs a definition while a defined class is more like a tag in a social network where it's definition are the members it contains.

kasbah commented 6 years ago

Is there any use case where it is important to distinguish between passive and active components?

When looking for one at a retailer site or in an EDA library. Like I said, I am just going by what people are already using to categorize. Yes, maybe it makes sense as a defined class.

I am quite eager to see an example output of this that could be used by electro-grammar. Do you know how that would work?

dvc94ch commented 6 years ago

I think that we would use electro-grammar to parse data like the cpl and output owl assertions. (Assertions are particulars that have an instanceof relationship to a universal in the taxonomy) For example the resistance field is a string in the cpl which needs to be parsed and modeled using the ontology's vocabulary.

Then we can run a reasoner on the dataset to infer things, like that a particular is a member of Passive because it is a Resistor.

Then we should be able to use electro grammar for matching future queries to the owl dataset (or via owlready2 sqlite3 db).