Reputation: 1103
I want to create a RDFS schema about venue info which contains for example:
address info.
I find another schema about it:https://schema.org/Place which has the property address info.
The first question is can I declare the Venue also has the property of address? I already know that I can use the property without declaring it. The reason I want to declare it to make my schema more clear.
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:place="https://schema.org/Place#"
xml:base="http://localhost:3000/VenueSchema#">
<rdfs:Class rdf:ID="Venue">
<rdfs:subClassOf rdf:resource="https://schema.org/Place"/>
</rdfs:Class>
<rdf:Property rdf:ID="address">
<rdf:type source:"https://schema.org/Place#address">
</rdf:Property>
</rdf:RDF>
The second question is can I redefine the property address? Can it achieve override or overload effects?
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:place="https://schema.org/Place#"
xml:base="http://localhost:3000/VenueSchema#">
<rdfs:Class rdf:ID="Venue">
<rdfs:subClassOf rdf:resource="https://schema.org/Place"/>
</rdfs:Class>
<rdf:Property rdf:ID="address">
<rdfs:domain rdf:resource= "#Venue">
<rdfs:range rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
</rdf:Property>
</rdf:RDF>
Upvotes: 1
Views: 337
Reputation: 85813
The first question is can I declare the Venue also has the property of address? I already know that I can use the property without declaring it. The reason I want to declare it to make my schema more clear.
Classes don't have properties in RDFS. Properties can have declared domains and ranges, but that doesn't make properties belong to classes. When you say that
p rdfs:domain D
you're saying that when x p y, you can infer that x rdf:type D. That's all the domain axiom does. The range axiom is similar, but lets you infer a type for y. You can declare additional domains and ranges on a property, but be aware that that means that you'll be able to infer that with that property belong to all the domains. E.g., if you say that:
hasFoot rdfs:domain Elephant
and
hasFoot rdfs:domain Human
then when you see that Jimbo hasFoot foot73, you're going to be able to infer that Jimbo is a Human and an Elephant.
The second question is can I redefine the property address? Can it achieve override or overload effects?
You can say additional things about resources; that's one of the wonderful things about the Semantic Web. However, you can't make anyone else retract what they've said about, though you're free to ignore what they've said. That is, you can include declarations of a property even if someone else has already declared them. The RDF data model is based on a set of triples, and triples don't include duplicates, so there's no difference whether you say something once or a hundred times.
It doesn't make sense to talk about overriding or overloading, though. I've said it before in the answers to some of your earlier questions, but RDF is not an object oriented programming language, even though it has a notion of properties and classes. A property is just an IRI. It doesn't have any behavior or side effects. You can say additional things about a property, and you ignore things that others have said about them, but there's sense in which you can override or overload a property.
You can define subproperties, which might be useful. E.g., you can say:
:hasParent a rdfs:Property ;
rdfs:range :Human .
:hasMother a rdfs:Property ;
rdfs:range :Woman ;
rdfs:subPropertyOf :hasParent .
If you do this, then when you say x hasMother y, you can infer that y is a Woman and a Human, and you can infer that x hasParent y.
Upvotes: 2