-
Notifications
You must be signed in to change notification settings - Fork 77
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
Subclasses of Quantity are instances of Quantity too. #61
Comments
Read through the section on Substances in the README: https://github.com/BrickSchema/Brick#substances we are punning substances by treating them as singletons. I think this makes the data model more intuitive. The plan is not to instantiate substances beyond the punned instances |
I understand that's for Substances but my observation is for Quantities. |
Sorry! I got mixed up. Its the same principle though |
I see, but I found that punning isn't applied to Substances. Can you verify that? The same query does not work for Substances. And could you point out which part of the code enables the punning? I just want to understand how it's implemented. |
It's a little weird because we don't actually instantiate them anywhere, but I think I understand what's going on. Punning is applied to both Quantities and Substances; the "pun" part is where we say that the value of a certain property is a single instance which is has the same name as the class. Loosely, this is lines https://github.com/BrickSchema/Brick/blob/master/generate_brick.py#L83-L84 instantiated by lines like https://github.com/BrickSchema/Brick/blob/master/sensor.py#L14. When this is serialized into the turtle file, it looks like https://github.com/BrickSchema/Brick/blob/master/Brick.ttl#L252-L254: When we use a Quantity or Substance in this way as part of a definition, it becomes implicitly "instantiated" . So when you are doing your query above, because you are using However I would expect some of the substance classes to show up when doing that query. I'm not 100% sure why that's happening, but it smells like there's a bug somewhere. I'll investigate tomorrow |
I assume this reaction from owlready2 when loading the Brick ontology is related: `
|
Good point! That probably has something to do with it. Wish it told us what was cyclic though. We've uncovered that owlready2 doesn't provide all of the reasoning we require. owlrl does, but it can take a few hours to actually perform the reasoning. I'm running some tests + experiments to track down what's going on with this particular issue with instantiating Quantities and hope to have news to report soon. @jbkoh how do you feel about quantities being instances?
|
I've been trying to reconcile this discussion with the SOSA/SSN model. I was expecting that |
I think that's the right way of looking at it. Our A related question, @JoelBender: is it more common to use |
(assuming |
I'm trying to implement some of these fixes in #76 I like that we differentiate between Substances and Quantities, but it would be useful to group both of these under an abstract "Measureable" class, which could be a subclass of |
@gtfierro I am not sure what we can get from Quantities and Substances being instances. If we at some point want to instantiate Substances (e.g., |
No worries! It's a bit of a subtle issue. The owl2 wiki has a nice discussion of it that I will adapt here. Punning is a feature in OWL 2 that allows for a more flexible modeling strategy when it comes to classes and individuals (what OWL calls "instances" of a class). The OWL2 wiki has an example for eagles, but I'll adapt it for In Brick 1.1.0, the term
Punning our substances and quantities means that we can use the same terms (e.g.
Without punning, the OWL restriction that instances of brick:Air_Temperature_Sensor a owl:Class ;
owl:equivalentClass [ owl:intersectionOf (
[ a owl:Restriction ;
owl:hasValue brick:Temperature ;
owl:onProperty brick:measures ]
[ a owl:Restriction ;
owl:hasValue brick:Air ;
owl:onProperty brick:measures ]
) ], Hope that helps; it took me a while to figure this out myself. |
I am fine with punning itself as we already discussed. I was curious if we need to do anything inside the model for punning. As far as I understood, we don't need anything but just Restrictions, which is already included in Brick.ttl. That's why I am confused about what you are trying to modify. I interpreted, when you said, "Operative_Temperature is a type of Temperature" as |
The key is its both |
Are you saying that we need this? brick:Operative_Temperature a brick:Temperature Maybe this part wasn't clear to me in the docs you provided. I thought we just needed to define classes while we allow associating them with instances. What is the problem with the below example? brick:Operative_Temperature rdfs:subClassOf brick:Temperature.
ex:sensor1 brick:measures brick:Operative_Temperature. |
Nothing is wrong with the second one: that's specifically what we are allowing. The question I'm trying to investigate is whether or not making puns explicit helps us in any way. The following in a Brick model is a "correct" pun
This means, however, that Substances + Quantities are only ever realized as individuals if there is another individual (e.g. By explicitly including in Brick statements like
we might be able to make reasoning about quantity/substance instances easier. It might only be worth doing that for the tests, though, so I might drop it Is your only objection to the current model the fact that I'm explicitly instantiating the substances and quantities as members of the parent class? |
After OWL reasoning, Brick.ttl assumes that all the subclasses of
brick:Quantity
are instances ofbrick:Quantity
too. Please check the regenerator code: https://gist.github.com/jbkoh/37fbec75d023eff23baeee0e7c721dd0Quantity subclasses should not be instances, right?
I am also not sure if we want to instantiate
brick:Quantity
as entities. I see potential usage such as provenance tracking, but will it be actually used?The text was updated successfully, but these errors were encountered: