On 08/08/16 17:19, Simon Schäfer wrote:
---- On Mon, 08 Aug 2016 10:28:55 +0200 Dave Reynolds <[email protected]>wrote ---- > > This doesn't matter for your later questions but this example looks like > it is confusing classes and properties. > > s: seems to be a property so the relationship between sc: and sd: to s: > should be rdfs:subPropertyOf. Indeed, that is better. > > Using the namespace itself (e.g. sc:) as the URI for a class is not > wrong but is unusual and might cause confusion. What is the usual case? Having the class in a separate namespace?
Normally a namespace contains a whole set of related classes and properties so the class would be: sc:MyClassName
I could do that but I wondered how to easily document that some properties belong only to a single class for example, while other properties belong to multiple classes.
The nearest thing to declaring how properties relate to classes in RDFS/OWL is to use domain/range and/or cardinality restrictions.
Just because they are in the same namespace tells you nothing about how they relate. A namespace isn't like a qualified classname in java.
> > The purpose of the snippet above is to create an object of type `http://x.test/schema/Class/0.1/` and give it a name. There is also the type `http://x.test/schema/Decl/0.1/`, which is a super type of the previous type. > > In the above snippet it's a super property not a super type. Indeed, I got this wrong. Would the following be correct? prefix sd:<http://x.test/schema/Decl/0.1/> prefix sc:<http://x.test/schema/Class/0.1/> prefix c:<http://x.test/data/Class/0.1/> prefix rdfs:<http://www.w3.org/2000/01/rdf-schema#> prefix s:<http://schema.org/> insert data { sc: rdfs:subClassOf sd: . sc:name rdfs:subPropertyOf s:name . sd:name rdfs:subPropertyOf s:name . c:ClassName a sc: . c:ClassName sc:name "ClassName" . }
It's legal. Since sc: is a class then your c:ClassName is an instance of sc:. So unless sc: is a class of classes then your c:ClassName is actually an instance sc: and probably not a class it its own right. So a name more like "c:instance" would be more common.
> > > The types of the names are not important, the only thing that is important is that `Class` shares all the properties that are also part of `Decl`. > > Nothing in the above says that. There is nothing here about properties > being "part of" Class or Decl. In RDFS/OWL properties exist independent > of classes. That can be related (via domain/range or the various OWL > restrictions) but it's not like object oriented modelling. Ok, I think I understand that now. How would I explain such relationships then. With rules that Jena can understand?
The RDFS and (useful subsets of) OWL semantics are provided by the building reasoner configurations - no need to write your own rules for those.
Dave
