RDF : Is it possible to set the range of a property to a literal in Turtle

574 views Asked by At

I m very new to RDF. I want to know if it is ok to write something like this ?

<firstname> a rdf:Property
    rdfs:domain <Person> ;
    rdfs:range xsd:String ;
1

There are 1 answers

1
Dilini Peiris On

I think there should be a semicolon at the end of the first line as follows since you are continuing the same subject predicate. And to conclude the rdfs statement (if there is no other things to define), you should end the statement with a period.

<firstname> a rdf:Property ;
    rdfs:domain <Person> ;
    rdfs:range xsd:string .

Here a in the first line can also be replaced by rdf:type. According to my knowledge, they both refer to the same.

Following is also an acceptable version as mentioned by Stanislav Kralin.

<firstname> a rdf:Property ;
    rdfs:domain <Person> ;
    rdfs:range rdfs:Literal .