Closed ExarcaFidalgo closed 4 years ago
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string; :age xsd:int ?; }
:Ultrauser { a [:User]; }
:Titanuser @:User AND { :titancode xsd:string; }
:VIPUser EXTRA a { a @:User; }
Si deseamos ser coherentes con el UML, Titanuser debería tener una relación AND a un hijo vacío, cuya shape {titancode... } fuera a su vez su hijo. ARREGLADO
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User IRI { :name xsd:string; }
:Ultrauser Literal AND { a [:User]; }
:Titanuser @:User AND NonLiteral AND { }
<Product> BNode AND { }
<AThing> IRI
Al igual que el anterior, habría que expresar ese AND con { }:
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string /[a-z]+/; :age xsd:int MinInclusive 18 ?; :c xsd:int TotalDigits 3; :d xsd:int FractionDigits 4; :e xsd:string Length 6; :f xsd:string MinLength 3; :g xsd:string MaxLength 15; }
prefix : https://schema.org/ prefix codes: http://example.codes/ base http://example.org/
:Product { :status [codes:~ - codes:unknown - codes:bad.~ "111" ]; :phone ["+34"~ - "+3468031" - "+3467182"~ ]; :quantity [99~ - 9987 - 991~ ]; :url [codes:Personal~ ]; }
prefix codes: http://example.codes/
prefix : http://schema.org/ base http://example.org/
:Product { :status [. - codes:bad ]; :name [. - "Trademark" ]; :price [. - 66 ]; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:FrenchProduct { :frlabel [@fr ]; }
:EnglishProduct { :enlabel [@en~ ]; }
:SpanishProduct { :splabel [@es~ - @es-AR - @es-ES ]; }
:AnyProduct { :label [. - @kz ]; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string; ( :givenName xsd:string; :familyName xsd:string; ) ? ; ( :has @<Something> {2,}; :c xsd:string; ) * ; :owns @:Garage; }
:Garage { ( <AE86> xsd:string; ( <Levin> xsd:string; <Cilinders> xsd:int; ) ? ; ( <Trueno> xsd:string; <Cilinders> xsd:int; ) ? ; ) + ; }
<Something> { }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string; | ( :givenName xsd:string +; :familyName xsd:string; ); }
:Car { :model xsd:string; ( :turbo xsd:string; | :misfiring xsd:string; | :atm xsd:string;) {1,2}; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:Car { :name xsd:string; :belongs @_:1; }
:Garage { }
:User { :name xsd:string; :worksFor { a [:Company]; }; }
:Company { }
:GreatGrandson { :parent { :parent { :parent . +; }; }; }
_:1 { a [:Garage]; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User IRI CLOSED { :name xsd:string MaxLength 3; :age xsd:int ?; :gender [:Male :Female ]; :knows @:User; }
:Company CLOSED { :name xsd:string; }
Con el nuevo AND:
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:Person { }
:User { ^a [:Person]; ^:name xsd:string; ^:gender [:Male :Female ]; }
:Company { ^:worksFor @:User +; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:FollowSpaniards EXTRA :follows { :follows { :nationality [:Spain ]; } +; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { $:name ( :name .; | ( :givenName .; :familyName .; );) ; :email IRI; }
:Employee { &:name; :employeeId .; }
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string; :owns IRI; } AND { :owns @:Product; }
:Titanuser @:User AND { :titancode xsd:string; } AND { :owns Literal; }
:Ultrauser Literal AND { a [:User]; }
:Product { :productId xsd:string MinLength 5 AND MaxLength 10; }
Con el nuevo AND:
prefix : https://schema.org/ prefix xsd: http://www.w3.org/2001/XMLSchema# base http://example.org/
:User { :name xsd:string; :owns IRI; } OR { :owns @:Product; }
:Titanuser @:User OR { :titancode xsd:string; } OR { :owns Literal; }
:Product { :productId xsd:string OR MinLength 5 OR MaxLength 10; }
Actualizado y cerrado.
ShEx básico