- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Mon, 14 Apr 2014 21:22:13 +0200
- To: 'Josue Alexander Baquiax Batén' <alexander_ges@galileo.edu>
- Cc: <public-hydra@w3.org>
On Tuesday, April 08, 2014 11:57 PM, Josue Alexander Baquiax wrote: > 2014-04-08 14:41 GMT-06:00 Markus Lanthaler: > > On Monday, March 31, 2014 10:11 PM, Josue Alexander Baquiax Batén wrote: > > I'm working with Hydra Core and I have a question. > > > > In RDF:subClassOf the class A that inherit from B, inherit all > > properties of B. It work of the same way with hydra:subClass? > > I made this comment based in this info [1] , but I believe that I was > confused. I'm sorry. Oh OK.. it's a bit ambiguous the way it is written but it should probably be fixed... and no need to apologize :-) > > That's not true. In RDF properties are only loosely bound to classes. > > Generally, you can use any property with any class. If a property has a > > specific domain set, that means that the resource will also become an > > instance of that class. So if you have (pseudo-code) > > I'm understanding now. > (I have read http://www.rdfabout.com/intro/?section=contents and my > ideas are being clarified now) In general, I always suggest to read the specifications as they have the final say. In this case it would be RDF Schema 1.1: http://www.w3.org/TR/rdf-schema/#ch_subclassof Unfortunately, specifications are often very hard to read and understand. So, in doubt, simply ask. There are a lot of very smart people on this list. > > propertyA domain ClassA > > propertyB domain ClassB > > > > ClassB subClassOf ClassA > > > > propertyC domain ClassC > > > > and you have a resource > > > > /something @type ClassB > > > > it means neither that /something has propertyB nor propertyC. On the > > other hand, > > I'm not sure if I understand this. It mean: not "ensures" that a > resource of @type ClassB has the property "propertyB" right? correct > me if I'm wrong. Right. If the propertyB isn't there, you basically don't know if that resource has that property or not. > > /something propertyB "Value of propertyB" > > > > means (infers) that /something is an instance of both ClassA and > > ClassB. I know, this is quite confusing if you come from an object- > > oriented programming world. So, if the explanation above is unclear, > > please don't hesitate to ask more questions. I'm more than happy to > > explain this in more detail. > > Then, What meaning that /something is an instance of both ClassA and > ClassB? What benefits I have with this situation? :) Thanks, I believe > that I need more help. That depends on your application. Lets use "firstname" instead of "propertyB". If you have a resource that has a first name, you would *know*, i.e., it can be inferred, that that resource is a Person. That might be interesting for your application to choose the right template or something like that. [...] > > > Basically I need define a class with its properties, and make a > > > subclass of this, that inherit its (first Class mentioned) > > > properties; > > > > It doesn't inherit properties because you haven't defined any (from a > > Hydra perspectice). You just defined some whose domain happens to be > > mm:User... > > It mean, I can't do this right? :( Have yo You have any idea to do > this possible? Or it is imposilble. See below > > > so that in this example "supportedProperties" will be emtpy. > > > > ... so you need to reference them from supportedProperties as follows: > > > > "@id":"vocab:User", > > "supportedProperty": [ > > { "property": "mm:userId" } > > ... > > ] > > Then, I should re-write the definitions, right? No, you don't ned to rewrite them. You just need to add the "supportedProperty" to vocab:User and reference the properties there as shown in the snippet above. The rest is fine. Hope this helps. If you have further questions, please don't hesitate to ask them here. Cheers, Markus [1] http://hydrogen.informatik.tu-cottbus.de/wiki/index.php/Property_rdfs:subCla ssOf -- Markus Lanthaler @markuslanthaler
Received on Monday, 14 April 2014 19:23:10 UTC