Shex/Obsolote/Encoding of instanceof
To define an instance of class in SHEX level 1 the following encoding can be used
ex:Person {
age xsd:int,
rdf:type (ex:Person) #force the rdf:type property to reference to ex:Person making it an ex:Person instance
}
When having a sub class of it can be encoded using the following approach
ex:Person { age xsd:int, rdf:type (ex:Person,ex:Female,ex:Male) #must be either be instanceof ex:Person, ex:Female, ex:Male } ex:Female { ex:boyFriend @ex:Male, rdf:type (ex:Female) #must be instanceof ex:Female } ex:Male { ex:girlFriend @ex:Female, rdf:type (ex:Male) #must be instanceof ex:Male }
This would be more nicely encoded if the elements in discussion point(Discussion_SHEX_format, Discussion 2, Redefining rules) would be available.
See Encoding_of_greedy_matching for the encoding of VIRTUAL.