rdf4h 4.0.2 → 5.0.1
raw patch · 33 files changed
+6458/−1032 lines, 33 filesdep +template-haskelldep +temporary
Dependencies added: template-haskell, temporary
Files
- rdf4h.cabal +33/−4
- resources/dcterms.ttl +1037/−0
- resources/foaf.ttl +697/−0
- resources/owl.ttl +620/−0
- resources/rdf.ttl +144/−0
- resources/rdfs.ttl +125/−0
- resources/shacl.ttl +1462/−0
- resources/skos.ttl +278/−0
- resources/vann.ttl +82/−0
- resources/xsd.ttl +221/−0
- src/Data/RDF/BlankNode.hs +89/−0
- src/Data/RDF/IRI.hs +177/−134
- src/Data/RDF/State.hs +140/−0
- src/Data/RDF/Types.hs +368/−317
- src/Data/RDF/Vocabulary/DCTerms.hs +12/−0
- src/Data/RDF/Vocabulary/FOAF.hs +12/−0
- src/Data/RDF/Vocabulary/Generator/VocabularyGenerator.hs +162/−0
- src/Data/RDF/Vocabulary/OWL.hs +12/−0
- src/Data/RDF/Vocabulary/RDF.hs +12/−0
- src/Data/RDF/Vocabulary/RDFS.hs +12/−0
- src/Data/RDF/Vocabulary/SHACL.hs +12/−0
- src/Data/RDF/Vocabulary/SKOS.hs +12/−0
- src/Data/RDF/Vocabulary/VANN.hs +12/−0
- src/Data/RDF/Vocabulary/XSD.hs +12/−0
- src/Text/RDF/RDF4H/NTriplesParser.hs +116/−99
- src/Text/RDF/RDF4H/TurtleSerializer.hs +17/−38
- src/Text/RDF/RDF4H/TurtleSerializer/Internal.hs +56/−0
- src/Text/RDF/RDF4H/XmlParser.hs +192/−240
- testsuite/tests/Data/RDF/BlankNodeTests.hs +34/−0
- testsuite/tests/Data/RDF/IRITests.hs +153/−124
- testsuite/tests/Test.hs +77/−75
- testsuite/tests/Text/RDF/RDF4H/TurtleSerializerTest.hs +69/−0
- testsuite/tests/W3C/W3CAssertions.hs +1/−1
rdf4h.cabal view
@@ -1,5 +1,5 @@ name: rdf4h-version: 4.0.2+version: 5.0.1 synopsis: A library for RDF processing in Haskell description: 'RDF for Haskell' is a library for working with RDF in Haskell.@@ -7,10 +7,11 @@ and Turtle, and an RDF parser for RDF/XML. It provides the ability to query for triples containing a particular subject, predicate, or object, or selecting triples that satisfy an arbitrary predicate function. It- also supports IRI parsing and resolution.+ also supports IRI parsing and resolution, and compiled-time+ generation of Haskell modules from Turtle schema files. -author: Rob Stewart, Pierre Le Marre, Slava Kravchenko, Calvin Smith-copyright: (c) Rob Stewart, Pierre Le Marre, Slava Kravchenko, Calvin Smith, Renzo Carbonara+author: Rob Stewart, Pierre Le Marre, Slava Kravchenko, Calvin Smith, Fabian Meyer+copyright: (c) Rob Stewart, Pierre Le Marre, Slava Kravchenko, Calvin Smith, Renzo Carbonara, Fabian Meyer maintainer: Rob Stewart <robstewart57@gmail.com> homepage: https://github.com/robstewart57/rdf4h bug-reports: https://github.com/robstewart57/rdf4h/issues@@ -25,6 +26,15 @@ extra-source-files: examples/ParseURLs.hs , examples/ESWC.hs , examples/BuildRDFGraph.hs+ , resources/dcterms.ttl+ , resources/foaf.ttl+ , resources/skos.ttl+ , resources/owl.ttl+ , resources/rdfs.ttl+ , resources/rdf.ttl+ , resources/shacl.ttl+ , resources/vann.ttl+ , resources/xsd.ttl source-repository head type: git@@ -34,6 +44,7 @@ default-language: Haskell2010 hs-source-dirs: src exposed-modules: Data.RDF+ , Data.RDF.BlankNode , Data.RDF.IRI , Data.RDF.Namespace , Data.RDF.Types@@ -41,6 +52,17 @@ , Data.RDF.Graph.AdjHashMap , Data.RDF.Graph.AlgebraicGraph , Data.RDF.Graph.TList+ , Data.RDF.State+ , Data.RDF.Vocabulary.Generator.VocabularyGenerator+ , Data.RDF.Vocabulary.DCTerms+ , Data.RDF.Vocabulary.OWL+ , Data.RDF.Vocabulary.RDF+ , Data.RDF.Vocabulary.XSD+ , Data.RDF.Vocabulary.VANN+ , Data.RDF.Vocabulary.SHACL+ , Data.RDF.Vocabulary.RDFS+ , Data.RDF.Vocabulary.FOAF+ , Data.RDF.Vocabulary.SKOS , Text.RDF.RDF4H.TurtleParser , Text.RDF.RDF4H.TurtleSerializer , Text.RDF.RDF4H.NTriplesParser@@ -48,6 +70,7 @@ , Text.RDF.RDF4H.XmlParser , Text.RDF.RDF4H.XmlParser.Identifiers , Text.RDF.RDF4H.ParserUtils+ , Text.RDF.RDF4H.TurtleSerializer.Internal build-depends: attoparsec , base >= 4.8.0.0 , bytestring@@ -74,8 +97,10 @@ , selective , html-entities , xeno+ , template-haskell other-modules: Text.RDF.RDF4H.XmlParser.Xmlbf , Text.RDF.RDF4H.XmlParser.Xeno+ , Text.RDF.RDF4H.XmlParser.Xeno if impl(ghc < 7.6) build-depends: ghc-prim if !impl(ghc >= 8.0)@@ -104,6 +129,8 @@ other-modules: Data.RDF.PropertyTests Data.RDF.GraphImplTests Data.RDF.IRITests+ Data.RDF.BlankNodeTests+ Text.RDF.RDF4H.TurtleSerializerTest Text.RDF.RDF4H.TurtleParser_ConformanceTest Text.RDF.RDF4H.XmlParser_Test W3C.Manifest@@ -123,6 +150,8 @@ , filepath , directory , safe+ , temporary+ , bytestring if impl(ghc < 7.6) build-depends: ghc-prim
+ resources/dcterms.ttl view
@@ -0,0 +1,1037 @@+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .+@prefix dcam: <http://purl.org/dc/dcam/> .+@prefix dcterms: <http://purl.org/dc/terms/> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .++<http://purl.org/dc/terms/>+ dcterms:modified "2012-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:publisher <http://purl.org/dc/aboutdcmi#DCMI> ;+ <http://purl.org/vocab/vann/preferredNamespaceUri> "http://purl.org/dc/terms/";+ dcterms:title "DCMI Metadata Terms - other"@en .++dcterms:Agent+ dcterms:description "Examples of Agent include person, organization, and software agent."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Agent-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcterms:AgentClass, rdfs:Class ;+ rdfs:comment "A resource that acts or has the power to act."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Agent"@en .++dcterms:AgentClass+ dcterms:description "Examples of Agent Class include groups seen as classes, such as students, women, charities, lecturers."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#AgentClass-003> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2012-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A group of agents."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Agent Class"@en ;+ rdfs:subClassOf rdfs:Class .++dcterms:BibliographicResource+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#BibliographicResource-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A book, article, or other documentary resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Bibliographic Resource"@en .++dcterms:Box+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Box-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of regions in space defined by their geographic coordinates according to the DCMI Box Encoding Scheme."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "DCMI Box"@en ;+ rdfs:seeAlso <http://dublincore.org/documents/dcmi-box/> .++dcterms:DCMIType+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#DCMIType-005> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2012-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of classes specified by the DCMI Type Vocabulary, used to categorize the nature or genre of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "DCMI Type Vocabulary"@en ;+ rdfs:seeAlso <http://purl.org/dc/dcmitype/> .++dcterms:DDC+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#DDC-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of conceptual resources specified by the Dewey Decimal Classification."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "DDC"@en ;+ rdfs:seeAlso <http://www.oclc.org/dewey/> .++dcterms:FileFormat+ dcterms:description "Examples include the formats defined by the list of Internet Media Types."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#FileFormat-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A digital resource format."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "File Format"@en ;+ rdfs:subClassOf dcterms:MediaType .++dcterms:Frequency+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Frequency-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A rate at which something recurs."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Frequency"@en .++dcterms:IMT+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#IMT-004> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of media types specified by the Internet Assigned Numbers Authority."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "IMT"@en ;+ rdfs:seeAlso <http://www.iana.org/assignments/media-types/> .++dcterms:ISO3166+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#ISO3166-004> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of codes listed in ISO 3166-1 for the representation of names of countries."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "ISO 3166"@en ;+ rdfs:seeAlso <http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html> .++dcterms:ISO639-2+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#ISO639-2-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The three-letter alphabetic codes listed in ISO639-2 for the representation of names of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "ISO 639-2"@en ;+ rdfs:seeAlso <http://lcweb.loc.gov/standards/iso639-2/langhome.html> .++dcterms:ISO639-3+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#ISO639-3-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of three-letter codes listed in ISO 639-3 for the representation of names of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "ISO 639-3"@en ;+ rdfs:seeAlso <http://www.sil.org/iso639-3/> .++dcterms:Jurisdiction+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Jurisdiction-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "The extent or range of judicial, law enforcement, or other authority."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Jurisdiction"@en ;+ rdfs:subClassOf dcterms:LocationPeriodOrJurisdiction .++dcterms:LCC+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#LCC-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of conceptual resources specified by the Library of Congress Classification."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "LCC"@en ;+ rdfs:seeAlso <http://lcweb.loc.gov/catdir/cpso/lcco/lcco.html> .++dcterms:LCSH+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#LCSH-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of labeled concepts specified by the Library of Congress Subject Headings."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "LCSH"@en .++dcterms:LicenseDocument+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#LicenseDocument-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A legal document giving official permission to do something with a Resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "License Document"@en ;+ rdfs:subClassOf dcterms:RightsStatement .++dcterms:LinguisticSystem+ dcterms:description "Examples include written, spoken, sign, and computer languages."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#LinguisticSystem-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A system of signs, symbols, sounds, gestures, or rules used in communication."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Linguistic System"@en .++dcterms:Location+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Location-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A spatial region or named place."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Location"@en ;+ rdfs:subClassOf dcterms:LocationPeriodOrJurisdiction .++dcterms:LocationPeriodOrJurisdiction+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#LocationPeriodOrJurisdiction-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A location, period of time, or jurisdiction."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Location, Period, or Jurisdiction"@en .++dcterms:MESH+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#MESH-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of labeled concepts specified by the Medical Subject Headings."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "MeSH"@en ;+ rdfs:seeAlso <http://www.nlm.nih.gov/mesh/meshhome.html> .++dcterms:MediaType+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#MediaType-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A file format or physical medium."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Media Type"@en ;+ rdfs:subClassOf dcterms:MediaTypeOrExtent .++dcterms:MediaTypeOrExtent+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#MediaTypeOrExtent-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A media type or extent."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Media Type or Extent"@en .++dcterms:MethodOfAccrual+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#MethodOfAccrual-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A method by which resources are added to a collection."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Method of Accrual"@en .++dcterms:MethodOfInstruction+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#MethodOfInstruction-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A process that is used to engender knowledge, attitudes, and skills."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Method of Instruction"@en .++dcterms:NLM+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#NLM-002> ;+ dcterms:issued "2005-06-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of conceptual resources specified by the National Library of Medicine Classification."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "NLM"@en ;+ rdfs:seeAlso <http://wwwcf.nlm.nih.gov/class/> .++dcterms:Period+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Period-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of time intervals defined by their limits according to the DCMI Period Encoding Scheme."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "DCMI Period"@en ;+ rdfs:seeAlso <http://dublincore.org/documents/dcmi-period/> .++dcterms:PeriodOfTime+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#PeriodOfTime-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "An interval of time that is named or defined by its start and end dates."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Period of Time"@en ;+ rdfs:subClassOf dcterms:LocationPeriodOrJurisdiction .++dcterms:PhysicalMedium+ dcterms:description "Examples include paper, canvas, or DVD."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#PhysicalMedium-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A physical material or carrier."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Physical Medium"@en ;+ rdfs:subClassOf dcterms:MediaType .++dcterms:PhysicalResource+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#PhysicalResource-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A material thing."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Physical Resource"@en .++dcterms:Point+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Point-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of points in space defined by their geographic coordinates according to the DCMI Point Encoding Scheme."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "DCMI Point"@en ;+ rdfs:seeAlso <http://dublincore.org/documents/dcmi-point/> .++dcterms:Policy+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Policy-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A plan or course of action by an authority, intended to influence and determine decisions, actions, and other matters."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Policy"@en .++dcterms:ProvenanceStatement+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#ProvenanceStatement-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A statement of any changes in ownership and custody of a resource since its creation that are significant for its authenticity, integrity, and interpretation."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Provenance Statement"@en .++dcterms:RFC1766+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#RFC1766-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of tags, constructed according to RFC 1766, for the identification of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "RFC 1766"@en ;+ rdfs:seeAlso <http://www.ietf.org/rfc/rfc1766.txt> .++dcterms:RFC3066+ dcterms:description "RFC 3066 has been obsoleted by RFC 4646."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#RFC3066-002> ;+ dcterms:issued "2002-07-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of tags constructed according to RFC 3066 for the identification of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "RFC 3066"@en ;+ rdfs:seeAlso <http://www.ietf.org/rfc/rfc3066.txt> .++dcterms:RFC4646+ dcterms:description "RFC 4646 obsoletes RFC 3066."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#RFC4646-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of tags constructed according to RFC 4646 for the identification of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "RFC 4646"@en ;+ rdfs:seeAlso <http://www.ietf.org/rfc/rfc4646.txt> .++dcterms:RFC5646+ dcterms:description "RFC 5646 obsoletes RFC 4646."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#RFC5646-001> ;+ dcterms:issued "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of tags constructed according to RFC 5646 for the identification of languages."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "RFC 5646"@en ;+ rdfs:seeAlso <http://www.ietf.org/rfc/rfc5646.txt> .++dcterms:RightsStatement+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#RightsStatement-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A statement about the intellectual property rights (IPR) held in or over a Resource, a legal document giving official permission to do something with a resource, or a statement about access rights."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Rights Statement"@en .++dcterms:SizeOrDuration+ dcterms:description "Examples include a number of pages, a specification of length, width, and breadth, or a period in hours, minutes, and seconds."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#SizeOrDuration-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A dimension or extent, or a time taken to play or execute."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Size or Duration"@en ;+ rdfs:subClassOf dcterms:MediaTypeOrExtent .++dcterms:Standard+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#Standard-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Class ;+ rdfs:comment "A basis for comparison; a reference point against which other things can be evaluated."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Standard"@en .++dcterms:TGN+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#TGN-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of places specified by the Getty Thesaurus of Geographic Names."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "TGN"@en ;+ rdfs:seeAlso <http://www.getty.edu/research/tools/vocabulary/tgn/index.html> .++dcterms:UDC+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#UDC-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a dcam:VocabularyEncodingScheme ;+ rdfs:comment "The set of conceptual resources specified by the Universal Decimal Classification."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "UDC"@en ;+ rdfs:seeAlso <http://www.udcc.org/> .++dcterms:URI+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#URI-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of identifiers constructed according to the generic syntax for Uniform Resource Identifiers as specified by the Internet Engineering Task Force."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "URI"@en ;+ rdfs:seeAlso <http://www.ietf.org/rfc/rfc3986.txt> .++dcterms:W3CDTF+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#W3CDTF-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdfs:Datatype ;+ rdfs:comment "The set of dates and times constructed according to the W3C Date and Time Formats Specification."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "W3C-DTF"@en ;+ rdfs:seeAlso <http://www.w3.org/TR/NOTE-datetime> .++dcterms:abstract+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#abstract-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A summary of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Abstract"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/description>, dcterms:description .++dcterms:accessRights+ dcterms:description "Access Rights may include information regarding access or restrictions based on privacy, security, or other policies."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#accessRights-002> ;+ dcterms:issued "2003-02-15"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Information about who can access the resource or an indication of its security status."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Access Rights"@en ;+ rdfs:range dcterms:RightsStatement ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/rights>, dcterms:rights .++dcterms:accrualMethod+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#accrualMethod-003> ;+ dcterms:issued "2005-06-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The method by which items are added to a collection."@en ;+ rdfs:domain <http://purl.org/dc/dcmitype/Collection> ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Accrual Method"@en ;+ rdfs:range dcterms:MethodOfAccrual .++dcterms:accrualPeriodicity+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#accrualPeriodicity-003> ;+ dcterms:issued "2005-06-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The frequency with which items are added to a collection."@en ;+ rdfs:domain <http://purl.org/dc/dcmitype/Collection> ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Accrual Periodicity"@en ;+ rdfs:range dcterms:Frequency .++dcterms:accrualPolicy+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#accrualPolicy-003> ;+ dcterms:issued "2005-06-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The policy governing the addition of items to a collection."@en ;+ rdfs:domain <http://purl.org/dc/dcmitype/Collection> ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Accrual Policy"@en ;+ rdfs:range dcterms:Policy .++dcterms:alternative+ dcterms:description "The distinction between titles and alternative titles is application-specific."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#alternative-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An alternative name for the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Alternative Title"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/title>, dcterms:title .++dcterms:audience+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#audience-003> ;+ dcterms:issued "2001-05-21"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A class of entity for whom the resource is intended or useful."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Audience"@en ;+ rdfs:range dcterms:AgentClass .++dcterms:available+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#available-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date (often a range) that the resource became or will become available."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Available"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:bibliographicCitation+ dcterms:description "Recommended practice is to include sufficient bibliographic detail to identify the resource as unambiguously as possible."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#bibliographicCitation-002> ;+ dcterms:issued "2003-02-15"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A bibliographic reference for the resource."@en ;+ rdfs:domain dcterms:BibliographicResource ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Bibliographic Citation"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/identifier>, dcterms:identifier .++dcterms:conformsTo+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#conformsTo-003> ;+ dcterms:issued "2001-05-21"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An established standard to which the described resource conforms."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Conforms To"@en ;+ rdfs:range dcterms:Standard ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation .++dcterms:contributor+ dcterms:description "Examples of a Contributor include a person, an organization, or a service."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#contributorT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An entity responsible for making contributions to the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Contributor"@en ;+ rdfs:range dcterms:Agent ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/contributor> .++dcterms:coverage+ dcterms:description "Spatial topic and spatial applicability may be a named place or a location specified by its geographic coordinates. Temporal topic may be a named period, date, or date range. A jurisdiction may be a named administrative entity or a geographic place to which the resource applies. Recommended best practice is to use a controlled vocabulary such as the Thesaurus of Geographic Names [TGN]. Where appropriate, named places or time periods can be used in preference to numeric identifiers such as sets of coordinates or date ranges."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#coverageT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The spatial or temporal topic of the resource, the spatial applicability of the resource, or the jurisdiction under which the resource is relevant."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Coverage"@en ;+ rdfs:range dcterms:LocationPeriodOrJurisdiction ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/coverage> .++dcterms:created+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#created-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date of creation of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Created"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:creator+ dcterms:description "Examples of a Creator include a person, an organization, or a service."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#creatorT-002> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An entity primarily responsible for making the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Creator"@en ;+ rdfs:range dcterms:Agent ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/creator>, dcterms:contributor ;+ owl:equivalentProperty <http://xmlns.com/foaf/0.1/maker> .++dcterms:date+ dcterms:description "Date may be used to express temporal information at any level of granularity. Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF]."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#dateT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A point or period of time associated with an event in the lifecycle of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date> .++dcterms:dateAccepted+ dcterms:description "Examples of resources to which a Date Accepted may be relevant are a thesis (accepted by a university department) or an article (accepted by a journal)."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#dateAccepted-002> ;+ dcterms:issued "2002-07-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date of acceptance of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Accepted"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:dateCopyrighted+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#dateCopyrighted-002> ;+ dcterms:issued "2002-07-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date of copyright."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Copyrighted"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:dateSubmitted+ dcterms:description "Examples of resources to which a Date Submitted may be relevant are a thesis (submitted to a university department) or an article (submitted to a journal)."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#dateSubmitted-002> ;+ dcterms:issued "2002-07-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date of submission of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Submitted"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:description+ dcterms:description "Description may include but is not limited to: an abstract, a table of contents, a graphical representation, or a free-text account of the resource."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#descriptionT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An account of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Description"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/description> .++dcterms:educationLevel+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#educationLevel-002> ;+ dcterms:issued "2002-07-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A class of entity, defined in terms of progression through an educational or training context, for which the described resource is intended."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Audience Education Level"@en ;+ rdfs:range dcterms:AgentClass ;+ rdfs:subPropertyOf dcterms:audience .++dcterms:extent+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#extent-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The size or duration of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Extent"@en ;+ rdfs:range dcterms:SizeOrDuration ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/format>, dcterms:format .++dcterms:format+ dcterms:description "Examples of dimensions include size and duration. Recommended best practice is to use a controlled vocabulary such as the list of Internet Media Types [MIME]."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#formatT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The file format, physical medium, or dimensions of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Format"@en ;+ rdfs:range dcterms:MediaTypeOrExtent ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/format> .++dcterms:hasFormat+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#hasFormat-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is substantially the same as the pre-existing described resource, but in another format."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Has Format"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:hasPart+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#hasPart-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is included either physically or logically in the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Has Part"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:hasVersion+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#hasVersion-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is a version, edition, or adaptation of the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Has Version"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:identifier+ dcterms:description "Recommended best practice is to identify the resource by means of a string conforming to a formal identification system. "@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#identifierT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An unambiguous reference to the resource within a given context."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Identifier"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/identifier> .++dcterms:instructionalMethod+ dcterms:description "Instructional Method will typically include ways of presenting instructional materials or conducting instructional activities, patterns of learner-to-learner and learner-to-instructor interactions, and mechanisms by which group and individual levels of learning are measured. Instructional methods include all aspects of the instruction and learning processes from planning and implementation through evaluation and feedback."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#instructionalMethod-002> ;+ dcterms:issued "2005-06-13"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A process, used to engender knowledge, attitudes and skills, that the described resource is designed to support."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Instructional Method"@en ;+ rdfs:range dcterms:MethodOfInstruction .++dcterms:isFormatOf+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isFormatOf-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is substantially the same as the described resource, but in another format."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Format Of"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:isPartOf+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isPartOf-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource in which the described resource is physically or logically included."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Part Of"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:isReferencedBy+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isReferencedBy-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that references, cites, or otherwise points to the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Referenced By"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:isReplacedBy+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isReplacedBy-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that supplants, displaces, or supersedes the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Replaced By"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:isRequiredBy+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isRequiredBy-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that requires the described resource to support its function, delivery, or coherence."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Required By"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:isVersionOf+ dcterms:description "Changes in version imply substantive changes in content rather than differences in format."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#isVersionOf-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource of which the described resource is a version, edition, or adaptation."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Is Version Of"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:issued+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#issued-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date of formal issuance (e.g., publication) of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Issued"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:language+ dcterms:description "Recommended best practice is to use a controlled vocabulary such as RFC 4646 [RFC4646]."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#languageT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A language of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Language"@en ;+ rdfs:range dcterms:LinguisticSystem ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/language> .++dcterms:license+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#license-002> ;+ dcterms:issued "2004-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A legal document giving official permission to do something with the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "License"@en ;+ rdfs:range dcterms:LicenseDocument ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/rights>, dcterms:rights .++dcterms:mediator+ dcterms:description "In an educational context, a mediator might be a parent, teacher, teaching assistant, or care-giver."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#mediator-003> ;+ dcterms:issued "2001-05-21"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An entity that mediates access to the resource and for whom the resource is intended or useful."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Mediator"@en ;+ rdfs:range dcterms:AgentClass ;+ rdfs:subPropertyOf dcterms:audience .++dcterms:medium+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#medium-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The material or physical carrier of the resource."@en ;+ rdfs:domain dcterms:PhysicalResource ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Medium"@en ;+ rdfs:range dcterms:PhysicalMedium ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/format>, dcterms:format .++dcterms:modified+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#modified-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date on which the resource was changed."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Modified"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .++dcterms:provenance+ dcterms:description "The statement may include a description of any changes successive custodians made to the resource."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#provenance-002> ;+ dcterms:issued "2004-09-20"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A statement of any changes in ownership and custody of the resource since its creation that are significant for its authenticity, integrity, and interpretation."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Provenance"@en ;+ rdfs:range dcterms:ProvenanceStatement .++dcterms:publisher+ dcterms:description "Examples of a Publisher include a person, an organization, or a service."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#publisherT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "An entity responsible for making the resource available."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Publisher"@en ;+ rdfs:range dcterms:Agent ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/publisher> .++dcterms:references+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#references-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is referenced, cited, or otherwise pointed to by the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "References"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:relation+ dcterms:description "Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system. "@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#relationT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Relation"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation> ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:replaces+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#replaces-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is supplanted, displaced, or superseded by the described resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Replaces"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:requires+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#requires-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource that is required by the described resource to support its function, delivery, or coherence."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Requires"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/relation>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:rights+ dcterms:description "Typically, rights information includes a statement about various property rights associated with the resource, including intellectual property rights."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#rightsT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Information about rights held in and over the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Rights"@en ;+ rdfs:range dcterms:RightsStatement ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/rights> .++dcterms:rightsHolder+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#rightsHolder-002> ;+ dcterms:issued "2004-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A person or organization owning or managing rights over the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Rights Holder"@en ;+ rdfs:range dcterms:Agent .++dcterms:source+ dcterms:description "The described resource may be derived from the related resource in whole or in part. Recommended best practice is to identify the related resource by means of a string conforming to a formal identification system."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#sourceT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A related resource from which the described resource is derived."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Source"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/source>, dcterms:relation ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:spatial+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#spatial-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Spatial characteristics of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Spatial Coverage"@en ;+ rdfs:range dcterms:Location ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/coverage>, dcterms:coverage .++dcterms:subject+ dcterms:description "Typically, the subject will be represented using keywords, key phrases, or classification codes. Recommended best practice is to use a controlled vocabulary."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#subjectT-002> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2012-06-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The topic of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Subject"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/subject> ;+ <http://www.w3.org/2004/02/skos/core#note> "This term is intended to be used with non-literal values as defined in the DCMI Abstract Model (http://dublincore.org/documents/abstract-model/). As of December 2007, the DCMI Usage Board is seeking a way to express this intention with a formal range declaration."@en .++dcterms:tableOfContents+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#tableOfContents-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A list of subunits of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Table Of Contents"@en ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/description>, dcterms:description .++dcterms:temporal+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#temporal-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Temporal characteristics of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Temporal Coverage"@en ;+ rdfs:range dcterms:PeriodOfTime ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/coverage>, dcterms:coverage .++dcterms:title+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#titleT-002> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2010-10-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "A name given to the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Title"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/title> .++dcterms:type+ dcterms:description "Recommended best practice is to use a controlled vocabulary such as the DCMI Type Vocabulary [DCMITYPE]. To describe the file format, physical medium, or dimensions of the resource, use the Format element."@en ;+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#typeT-001> ;+ dcterms:issued "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "The nature or genre of the resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Type"@en ;+ rdfs:range rdfs:Class ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/type> .++dcterms:valid+ dcterms:hasVersion <http://dublincore.org/usage/terms/history/#valid-003> ;+ dcterms:issued "2000-07-11"^^<http://www.w3.org/2001/XMLSchema#date> ;+ dcterms:modified "2008-01-14"^^<http://www.w3.org/2001/XMLSchema#date> ;+ a rdf:Property ;+ rdfs:comment "Date (often a range) of validity of a resource."@en ;+ rdfs:isDefinedBy <http://purl.org/dc/terms/> ;+ rdfs:label "Date Valid"@en ;+ rdfs:range rdfs:Literal ;+ rdfs:subPropertyOf <http://purl.org/dc/elements/1.1/date>, dcterms:date .+
+ resources/foaf.ttl view
@@ -0,0 +1,697 @@+@prefix foaf: <http://xmlns.com/foaf/0.1/> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .+@prefix dc11: <http://purl.org/dc/elements/1.1/> .+@prefix wot: <http://xmlns.com/wot/0.1/> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix ns0: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .+@prefix schema: <http://schema.org/> .+@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .+@prefix dc: <http://purl.org/dc/terms/> .+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix skos: <http://www.w3.org/2004/02/skos/core#> .++foaf:+ a owl:Ontology ;+ dc11:description "The Friend of a Friend (FOAF) RDF vocabulary, described using W3C RDF Schema and the Web Ontology Language." .++wot:assurance a owl:AnnotationProperty .+wot:src_assurance a owl:AnnotationProperty .+<http://www.w3.org/2003/06/sw-vocab-status/ns#term_status> a owl:AnnotationProperty .+dc11:description a owl:AnnotationProperty .+dc11:date a owl:AnnotationProperty .+rdfs:Class a owl:Class .+foaf:LabelProperty+ a rdfs:Class, owl:Class ;+ ns0:term_status "unstable" ;+ rdfs:label "Label Property" ;+ rdfs:comment "A foaf:LabelProperty is any RDF property with texual values that serve as labels." ;+ rdfs:isDefinedBy foaf: .++foaf:Person+ a rdfs:Class, owl:Class ;+ rdfs:label "Person" ;+ rdfs:comment "A person." ;+ ns0:term_status "stable" ;+ owl:equivalentClass schema:Person, <http://www.w3.org/2000/10/swap/pim/contact#Person> ;+ rdfs:subClassOf foaf:Agent, geo:SpatialThing ;+ rdfs:isDefinedBy foaf: ;+ owl:disjointWith foaf:Organization, foaf:Project .++foaf:Agent+ a owl:Class, rdfs:Class ;+ ns0:term_status "stable" ;+ rdfs:label "Agent" ;+ rdfs:comment "An agent (eg. person, group, software or physical artifact)." ;+ owl:equivalentClass dc:Agent .++geo:SpatialThing+ a owl:Class ;+ rdfs:label "Spatial Thing" .++foaf:Document+ a rdfs:Class, owl:Class ;+ rdfs:label "Document" ;+ rdfs:comment "A document." ;+ ns0:term_status "stable" ;+ owl:equivalentClass schema:CreativeWork ;+ rdfs:isDefinedBy foaf: ;+ owl:disjointWith foaf:Organization, foaf:Project .++foaf:Organization+ a rdfs:Class, owl:Class ;+ rdfs:label "Organization" ;+ rdfs:comment "An organization." ;+ ns0:term_status "stable" ;+ rdfs:subClassOf foaf:Agent ;+ rdfs:isDefinedBy foaf: ;+ owl:disjointWith foaf:Person, foaf:Document .++foaf:Group+ a rdfs:Class, owl:Class ;+ ns0:term_status "stable" ;+ rdfs:label "Group" ;+ rdfs:comment "A class of Agents." ;+ rdfs:subClassOf foaf:Agent .++foaf:Project+ a rdfs:Class, owl:Class ;+ ns0:term_status "testing" ;+ rdfs:label "Project" ;+ rdfs:comment "A project (a collective endeavour of some kind)." ;+ rdfs:isDefinedBy foaf: ;+ owl:disjointWith foaf:Person, foaf:Document .++foaf:Image+ a rdfs:Class, owl:Class ;+ ns0:term_status "stable" ;+ rdfs:label "Image" ;+ rdfs:comment "An image." ;+ owl:equivalentClass schema:ImageObject ;+ rdfs:subClassOf foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:PersonalProfileDocument+ a rdfs:Class, owl:Class ;+ rdfs:label "PersonalProfileDocument" ;+ rdfs:comment "A personal profile RDF document." ;+ ns0:term_status "testing" ;+ rdfs:subClassOf foaf:Document .++foaf:OnlineAccount+ a rdfs:Class, owl:Class ;+ ns0:term_status "testing" ;+ rdfs:label "Online Account" ;+ rdfs:comment "An online account." ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subClassOf owl:Thing .++owl:Thing rdfs:label "Thing" .+foaf:OnlineGamingAccount+ a rdfs:Class, owl:Class ;+ ns0:term_status "unstable" ;+ rdfs:label "Online Gaming Account" ;+ rdfs:comment "An online gaming account." ;+ rdfs:subClassOf foaf:OnlineAccount ;+ rdfs:isDefinedBy foaf: .++foaf:OnlineEcommerceAccount+ a rdfs:Class, owl:Class ;+ ns0:term_status "unstable" ;+ rdfs:label "Online E-commerce Account" ;+ rdfs:comment "An online e-commerce account." ;+ rdfs:subClassOf foaf:OnlineAccount ;+ rdfs:isDefinedBy foaf: .++foaf:OnlineChatAccount+ a rdfs:Class, owl:Class ;+ ns0:term_status "unstable" ;+ rdfs:label "Online Chat Account" ;+ rdfs:comment "An online chat account." ;+ rdfs:subClassOf foaf:OnlineAccount ;+ rdfs:isDefinedBy foaf: .++foaf:mbox+ a rdf:Property, owl:InverseFunctionalProperty, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "personal mailbox" ;+ rdfs:comment "A personal mailbox, ie. an Internet mailbox associated with exactly one owner, the first owner of this mailbox. This is a 'static inverse functional property', in that there is (across time and change) at most one individual that ever has any particular value for foaf:mbox." ;+ rdfs:domain foaf:Agent ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:mbox_sha1sum+ a rdf:Property, owl:InverseFunctionalProperty, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "sha1sum of a personal mailbox URI name" ;+ rdfs:comment "The sha1sum of the URI of an Internet mailbox associated with exactly one owner, the first owner of the mailbox." ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:gender+ a rdf:Property, owl:FunctionalProperty, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "gender" ;+ rdfs:comment "The gender of this Agent (typically but not necessarily 'male' or 'female')." ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:geekcode+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "geekcode" ;+ rdfs:comment "A textual geekcode for this person, see http://www.geekcode.com/geek.html" ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:dnaChecksum+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "DNA checksum" ;+ rdfs:comment "A checksum for the DNA of some thing. Joke." ;+ rdfs:isDefinedBy foaf: ;+ rdfs:range rdfs:Literal .++foaf:sha1+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "unstable" ;+ rdfs:label "sha1sum (hex)" ;+ rdfs:comment "A sha1sum hash, in hex." ;+ rdfs:domain foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:based_near+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "based near" ;+ rdfs:comment "A location that something is based near, for some broadly human notion of near." ;+ rdfs:domain geo:SpatialThing ;+ rdfs:range geo:SpatialThing ;+ rdfs:isDefinedBy foaf: .++foaf:title+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "title" ;+ rdfs:comment "Title (Mr, Mrs, Ms, Dr. etc)" ;+ rdfs:isDefinedBy foaf: .++foaf:nick+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "nickname" ;+ rdfs:comment "A short informal nickname characterising an agent (includes login identifiers, IRC and other chat nicknames)." ;+ rdfs:isDefinedBy foaf: .++foaf:jabberID+ a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "jabber ID" ;+ rdfs:comment "A jabber ID for something." ;+ rdfs:isDefinedBy foaf: ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:aimChatID+ a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "AIM chat ID" ;+ rdfs:comment "An AIM chat ID" ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf foaf:nick ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:skypeID+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "Skype ID" ;+ rdfs:comment "A Skype ID" ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf foaf:nick ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:icqChatID+ a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "ICQ chat ID" ;+ rdfs:comment "An ICQ chat ID" ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf foaf:nick ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:yahooChatID+ a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "Yahoo chat ID" ;+ rdfs:comment "A Yahoo chat ID" ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf foaf:nick ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:msnChatID+ a rdf:Property, owl:DatatypeProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "MSN chat ID" ;+ rdfs:comment "An MSN chat ID" ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf foaf:nick ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal .++foaf:name+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "name" ;+ rdfs:comment "A name for some thing." ;+ rdfs:domain owl:Thing ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: ;+ rdfs:subPropertyOf rdfs:label .++foaf:firstName+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "firstName" ;+ rdfs:comment "The first name of a person." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:lastName+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "lastName" ;+ rdfs:comment "The last name of a person." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:givenName+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "Given name" ;+ rdfs:comment "The given name of some person." ;+ rdfs:isDefinedBy foaf: .++foaf:givenname+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "Given name" ;+ rdfs:comment "The given name of some person." ;+ rdfs:isDefinedBy foaf: .++foaf:surname+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "Surname" ;+ rdfs:comment "The surname of some person." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:family_name+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "family_name" ;+ rdfs:comment "The family name of some person." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:familyName+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "familyName" ;+ rdfs:comment "The family name of some person." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:phone+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "phone" ;+ rdfs:comment "A phone, specified using fully qualified tel: URI scheme (refs: http://www.w3.org/Addressing/schemes.html#tel)." ;+ rdfs:isDefinedBy foaf: .++foaf:homepage+ a rdf:Property, owl:ObjectProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "stable" ;+ rdfs:label "homepage" ;+ rdfs:comment "A homepage for some thing." ;+ rdfs:subPropertyOf foaf:page, foaf:isPrimaryTopicOf ;+ rdfs:domain owl:Thing ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:weblog+ a rdf:Property, owl:ObjectProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "stable" ;+ rdfs:label "weblog" ;+ rdfs:comment "A weblog of some thing (whether person, group, company etc.)." ;+ rdfs:subPropertyOf foaf:page ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:openid+ a rdf:Property, owl:ObjectProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "openid" ;+ rdfs:comment "An OpenID for an Agent." ;+ rdfs:subPropertyOf foaf:isPrimaryTopicOf ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:tipjar+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "tipjar" ;+ rdfs:comment "A tipjar document for this agent, describing means for payment and reward." ;+ rdfs:subPropertyOf foaf:page ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:plan+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "plan" ;+ rdfs:comment "A .plan comment, in the tradition of finger and '.plan' files." ;+ rdfs:isDefinedBy foaf: ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal .++foaf:made+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "made" ;+ rdfs:comment "Something that was made by this agent." ;+ rdfs:domain foaf:Agent ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: ;+ owl:inverseOf foaf:maker .++foaf:maker+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "maker" ;+ rdfs:comment "An agent that made this thing." ;+ owl:equivalentProperty dc:creator ;+ rdfs:domain owl:Thing ;+ rdfs:range foaf:Agent ;+ rdfs:isDefinedBy foaf: ;+ owl:inverseOf foaf:made .++foaf:img+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "image" ;+ rdfs:comment "An image that can be used to represent some thing (ie. those depictions which are particularly representative of something, eg. one's photo on a homepage)." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Image ;+ rdfs:subPropertyOf foaf:depiction ;+ rdfs:isDefinedBy foaf: .++foaf:depiction+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "depiction" ;+ rdfs:comment "A depiction of some thing." ;+ rdfs:domain owl:Thing ;+ rdfs:range foaf:Image ;+ rdfs:isDefinedBy foaf: ;+ owl:inverseOf foaf:depicts .++foaf:depicts+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "depicts" ;+ rdfs:comment "A thing depicted in this representation." ;+ rdfs:range owl:Thing ;+ rdfs:domain foaf:Image ;+ rdfs:isDefinedBy foaf: ;+ owl:inverseOf foaf:depiction .++foaf:thumbnail+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "thumbnail" ;+ rdfs:comment "A derived thumbnail image." ;+ rdfs:domain foaf:Image ;+ rdfs:range foaf:Image ;+ rdfs:isDefinedBy foaf: .++foaf:myersBriggs+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "myersBriggs" ;+ rdfs:comment "A Myers Briggs (MBTI) personality classification." ;+ rdfs:domain foaf:Person ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:workplaceHomepage+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "workplace homepage" ;+ rdfs:comment "A workplace homepage of some person; the homepage of an organization they work for." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:workInfoHomepage+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "work info homepage" ;+ rdfs:comment "A work info homepage of some person; a page about their work for some organization." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:schoolHomepage+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "schoolHomepage" ;+ rdfs:comment "A homepage of a school attended by the person." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:knows+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "knows" ;+ rdfs:comment "A person known by this person (indicating some level of reciprocated interaction between the parties)." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Person ;+ rdfs:isDefinedBy foaf: .++foaf:interest+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "interest" ;+ rdfs:comment "A page about a topic of interest to this person." ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:topic_interest+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "topic_interest" ;+ rdfs:comment "A thing of interest to this person." ;+ rdfs:domain foaf:Agent ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:publications+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "publications" ;+ rdfs:comment "A link to the publications of this person." ;+ rdfs:domain foaf:Person ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:currentProject+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "current project" ;+ rdfs:comment "A current project this person works on." ;+ rdfs:domain foaf:Person ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:pastProject+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "past project" ;+ rdfs:comment "A project this person has previously worked on." ;+ rdfs:domain foaf:Person ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:fundedBy+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "funded by" ;+ rdfs:comment "An organization funding a project or person." ;+ rdfs:domain owl:Thing ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:logo+ a rdf:Property, owl:ObjectProperty, owl:InverseFunctionalProperty ;+ ns0:term_status "testing" ;+ rdfs:label "logo" ;+ rdfs:comment "A logo representing some thing." ;+ rdfs:domain owl:Thing ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:topic+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "topic" ;+ rdfs:comment "A topic of some page or document." ;+ rdfs:domain foaf:Document ;+ rdfs:range owl:Thing ;+ owl:inverseOf foaf:page ;+ rdfs:isDefinedBy foaf: .++foaf:primaryTopic+ a rdf:Property, owl:FunctionalProperty, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "primary topic" ;+ rdfs:comment "The primary topic of some page or document." ;+ rdfs:domain foaf:Document ;+ rdfs:range owl:Thing ;+ owl:inverseOf foaf:isPrimaryTopicOf ;+ rdfs:isDefinedBy foaf: .++foaf:focus+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "focus" ;+ rdfs:comment "The underlying or 'focal' entity associated with some SKOS-described concept." ;+ rdfs:domain skos:Concept ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++skos:Concept rdfs:label "Concept" .+foaf:isPrimaryTopicOf+ a rdf:Property, owl:InverseFunctionalProperty ;+ ns0:term_status "stable" ;+ rdfs:label "is primary topic of" ;+ rdfs:comment "A document that this thing is the primary topic of." ;+ rdfs:subPropertyOf foaf:page ;+ owl:inverseOf foaf:primaryTopic ;+ rdfs:domain owl:Thing ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:page+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "page" ;+ rdfs:comment "A page or document about this thing." ;+ rdfs:domain owl:Thing ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: ;+ owl:inverseOf foaf:topic .++foaf:theme+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "theme" ;+ rdfs:comment "A theme." ;+ rdfs:domain owl:Thing ;+ rdfs:range owl:Thing ;+ rdfs:isDefinedBy foaf: .++foaf:account+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "account" ;+ rdfs:comment "Indicates an account held by this agent." ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:OnlineAccount ;+ rdfs:isDefinedBy foaf: .++foaf:holdsAccount+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "archaic" ;+ rdfs:label "account" ;+ rdfs:comment "Indicates an account held by this agent." ;+ rdfs:domain foaf:Agent ;+ rdfs:range foaf:OnlineAccount ;+ rdfs:isDefinedBy foaf: .++foaf:accountServiceHomepage+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "testing" ;+ rdfs:label "account service homepage" ;+ rdfs:comment "Indicates a homepage of the service provide for this online account." ;+ rdfs:domain foaf:OnlineAccount ;+ rdfs:range foaf:Document ;+ rdfs:isDefinedBy foaf: .++foaf:accountName+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "testing" ;+ rdfs:label "account name" ;+ rdfs:comment "Indicates the name (identifier) associated with this online account." ;+ rdfs:domain foaf:OnlineAccount ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:member+ a rdf:Property, owl:ObjectProperty ;+ ns0:term_status "stable" ;+ rdfs:label "member" ;+ rdfs:comment "Indicates a member of a Group" ;+ rdfs:domain foaf:Group ;+ rdfs:range foaf:Agent ;+ rdfs:isDefinedBy foaf: .++foaf:membershipClass+ a rdf:Property, owl:AnnotationProperty ;+ ns0:term_status "unstable" ;+ rdfs:label "membershipClass" ;+ rdfs:comment "Indicates the class of individuals that are a member of a Group" ;+ rdfs:isDefinedBy foaf: .++foaf:birthday+ a rdf:Property, owl:FunctionalProperty, owl:DatatypeProperty ;+ ns0:term_status "unstable" ;+ rdfs:label "birthday" ;+ rdfs:comment "The birthday of this Agent, represented in mm-dd string form, eg. '12-31'." ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:age+ a rdf:Property, owl:FunctionalProperty, owl:DatatypeProperty ;+ ns0:term_status "unstable" ;+ rdfs:label "age" ;+ rdfs:comment "The age in years of some agent." ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .++foaf:status+ a rdf:Property, owl:DatatypeProperty ;+ ns0:term_status "unstable" ;+ rdfs:label "status" ;+ rdfs:comment "A string expressing what the user is happy for the general public (normally) to know about their current activity." ;+ rdfs:domain foaf:Agent ;+ rdfs:range rdfs:Literal ;+ rdfs:isDefinedBy foaf: .
+ resources/owl.ttl view
@@ -0,0 +1,620 @@+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .++<http://www.w3.org/2002/07/owl>+ rdfs:label "The OWL 2 Schema vocabulary (OWL 2)" ;+ a owl:Ontology ;+ rdfs:comment """+ This ontology partially describes the built-in classes and+ properties that together form the basis of the RDF/XML syntax of OWL 2.+ The content of this ontology is based on Tables 6.1 and 6.2+ in Section 6.4 of the OWL 2 RDF-Based Semantics specification,+ available at http://www.w3.org/TR/owl2-rdf-based-semantics/.+ Please note that those tables do not include the different annotations+ (labels, comments and rdfs:isDefinedBy links) used in this file.+ Also note that the descriptions provided in this ontology do not+ provide a complete and correct formal description of either the syntax+ or the semantics of the introduced terms (please see the OWL 2+ recommendations for the complete and normative specifications).+ Furthermore, the information provided by this ontology may be+ misleading if not used with care. This ontology SHOULD NOT be imported+ into OWL ontologies. Importing this file into an OWL 2 DL ontology+ will cause it to become an OWL 2 Full ontology and may have other,+ unexpected, consequences.+ """ ;+ rdfs:isDefinedBy <http://www.w3.org/TR/owl2-mapping-to-rdf/>, <http://www.w3.org/TR/owl2-rdf-based-semantics/>, <http://www.w3.org/TR/owl2-syntax/> ;+ rdfs:seeAlso <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-classes>, <http://www.w3.org/TR/owl2-rdf-based-semantics/#table-axiomatic-properties> ;+ <http://purl.org/vocab/vann/preferredNamespaceUri> "http://www.w3.org/2002/07/owl#";+ owl:imports <http://www.w3.org/2000/01/rdf-schema> .++owl:AllDifferent+ a rdfs:Class ;+ rdfs:comment "The class of collections of pairwise different individuals." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "AllDifferent" ;+ rdfs:subClassOf rdfs:Resource .++owl:AllDisjointClasses+ a rdfs:Class ;+ rdfs:comment "The class of collections of pairwise disjoint classes." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "AllDisjointClasses" ;+ rdfs:subClassOf rdfs:Resource .++owl:AllDisjointProperties+ a rdfs:Class ;+ rdfs:comment "The class of collections of pairwise disjoint properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "AllDisjointProperties" ;+ rdfs:subClassOf rdfs:Resource .++owl:Annotation+ a rdfs:Class ;+ rdfs:comment "The class of annotated annotations for which the RDF serialization consists of an annotated subject, predicate and object." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Annotation" ;+ rdfs:subClassOf rdfs:Resource .++owl:AnnotationProperty+ a rdfs:Class ;+ rdfs:comment "The class of annotation properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "AnnotationProperty" ;+ rdfs:subClassOf rdf:Property .++owl:AsymmetricProperty+ a rdfs:Class ;+ rdfs:comment "The class of asymmetric properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "AsymmetricProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:Axiom+ a rdfs:Class ;+ rdfs:comment "The class of annotated axioms for which the RDF serialization consists of an annotated subject, predicate and object." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Axiom" ;+ rdfs:subClassOf rdfs:Resource .++owl:Class+ a rdfs:Class ;+ rdfs:comment "The class of OWL classes." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Class" ;+ rdfs:subClassOf rdfs:Class .++owl:DataRange+ a rdfs:Class ;+ rdfs:comment "The class of OWL data ranges, which are special kinds of datatypes. Note: The use of the IRI owl:DataRange has been deprecated as of OWL 2. The IRI rdfs:Datatype SHOULD be used instead." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "DataRange" ;+ rdfs:subClassOf rdfs:Datatype .++owl:DatatypeProperty+ a rdfs:Class ;+ rdfs:comment "The class of data properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "DatatypeProperty" ;+ rdfs:subClassOf rdf:Property .++owl:DeprecatedClass+ a rdfs:Class ;+ rdfs:comment "The class of deprecated classes." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "DeprecatedClass" ;+ rdfs:subClassOf rdfs:Class .++owl:DeprecatedProperty+ a rdfs:Class ;+ rdfs:comment "The class of deprecated properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "DeprecatedProperty" ;+ rdfs:subClassOf rdf:Property .++owl:FunctionalProperty+ a rdfs:Class ;+ rdfs:comment "The class of functional properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "FunctionalProperty" ;+ rdfs:subClassOf rdf:Property .++owl:InverseFunctionalProperty+ a rdfs:Class ;+ rdfs:comment "The class of inverse-functional properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "InverseFunctionalProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:IrreflexiveProperty+ a rdfs:Class ;+ rdfs:comment "The class of irreflexive properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "IrreflexiveProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:NamedIndividual+ a rdfs:Class ;+ rdfs:comment "The class of named individuals." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "NamedIndividual" ;+ rdfs:subClassOf owl:Thing .++owl:NegativePropertyAssertion+ a rdfs:Class ;+ rdfs:comment "The class of negative property assertions." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "NegativePropertyAssertion" ;+ rdfs:subClassOf rdfs:Resource .++owl:Nothing+ a owl:Class ;+ rdfs:comment "This is the empty class." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Nothing" ;+ rdfs:subClassOf owl:Thing .++owl:ObjectProperty+ a rdfs:Class ;+ rdfs:comment "The class of object properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "ObjectProperty" ;+ rdfs:subClassOf rdf:Property .++owl:Ontology+ a rdfs:Class ;+ rdfs:comment "The class of ontologies." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Ontology" ;+ rdfs:subClassOf rdfs:Resource .++owl:OntologyProperty+ a rdfs:Class ;+ rdfs:comment "The class of ontology properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "OntologyProperty" ;+ rdfs:subClassOf rdf:Property .++owl:ReflexiveProperty+ a rdfs:Class ;+ rdfs:comment "The class of reflexive properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "ReflexiveProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:Restriction+ a rdfs:Class ;+ rdfs:comment "The class of property restrictions." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Restriction" ;+ rdfs:subClassOf owl:Class .++owl:SymmetricProperty+ a rdfs:Class ;+ rdfs:comment "The class of symmetric properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "SymmetricProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:Thing+ a owl:Class ;+ rdfs:comment "The class of OWL individuals." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "Thing" .++owl:TransitiveProperty+ a rdfs:Class ;+ rdfs:comment "The class of transitive properties." ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "TransitiveProperty" ;+ rdfs:subClassOf owl:ObjectProperty .++owl:allValuesFrom+ a rdf:Property ;+ rdfs:comment "The property that determines the class that a universal property restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "allValuesFrom" ;+ rdfs:range rdfs:Class .++owl:annotatedProperty+ a rdf:Property ;+ rdfs:comment "The property that determines the predicate of an annotated axiom or annotated annotation." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "annotatedProperty" ;+ rdfs:range rdfs:Resource .++owl:annotatedSource+ a rdf:Property ;+ rdfs:comment "The property that determines the subject of an annotated axiom or annotated annotation." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "annotatedSource" ;+ rdfs:range rdfs:Resource .++owl:annotatedTarget+ a rdf:Property ;+ rdfs:comment "The property that determines the object of an annotated axiom or annotated annotation." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "annotatedTarget" ;+ rdfs:range rdfs:Resource .++owl:assertionProperty+ a rdf:Property ;+ rdfs:comment "The property that determines the predicate of a negative property assertion." ;+ rdfs:domain owl:NegativePropertyAssertion ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "assertionProperty" ;+ rdfs:range rdf:Property .++owl:backwardCompatibleWith+ a owl:AnnotationProperty, owl:OntologyProperty ;+ rdfs:comment "The annotation property that indicates that a given ontology is backward compatible with another ontology." ;+ rdfs:domain owl:Ontology ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "backwardCompatibleWith" ;+ rdfs:range owl:Ontology .++owl:bottomDataProperty+ a owl:DatatypeProperty ;+ rdfs:comment "The data property that does not relate any individual to any data value." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "bottomDataProperty" ;+ rdfs:range rdfs:Literal .++owl:bottomObjectProperty+ a owl:ObjectProperty ;+ rdfs:comment "The object property that does not relate any two individuals." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "bottomObjectProperty" ;+ rdfs:range owl:Thing .++owl:cardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of an exact cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "cardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:complementOf+ a rdf:Property ;+ rdfs:comment "The property that determines that a given class is the complement of another class." ;+ rdfs:domain owl:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "complementOf" ;+ rdfs:range owl:Class .++owl:datatypeComplementOf+ a rdf:Property ;+ rdfs:comment "The property that determines that a given data range is the complement of another data range with respect to the data domain." ;+ rdfs:domain rdfs:Datatype ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "datatypeComplementOf" ;+ rdfs:range rdfs:Datatype .++owl:deprecated+ a owl:AnnotationProperty ;+ rdfs:comment "The annotation property that indicates that a given entity has been deprecated." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "deprecated" ;+ rdfs:range rdfs:Resource .++owl:differentFrom+ a rdf:Property ;+ rdfs:comment "The property that determines that two given individuals are different." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "differentFrom" ;+ rdfs:range owl:Thing .++owl:disjointUnionOf+ a rdf:Property ;+ rdfs:comment "The property that determines that a given class is equivalent to the disjoint union of a collection of other classes." ;+ rdfs:domain owl:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "disjointUnionOf" ;+ rdfs:range rdf:List .++owl:disjointWith+ a rdf:Property ;+ rdfs:comment "The property that determines that two given classes are disjoint." ;+ rdfs:domain owl:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "disjointWith" ;+ rdfs:range owl:Class .++owl:distinctMembers+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of pairwise different individuals in a owl:AllDifferent axiom." ;+ rdfs:domain owl:AllDifferent ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "distinctMembers" ;+ rdfs:range rdf:List .++owl:equivalentClass+ a rdf:Property ;+ rdfs:comment "The property that determines that two given classes are equivalent, and that is used to specify datatype definitions." ;+ rdfs:domain rdfs:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "equivalentClass" ;+ rdfs:range rdfs:Class .++owl:equivalentProperty+ a rdf:Property ;+ rdfs:comment "The property that determines that two given properties are equivalent." ;+ rdfs:domain rdf:Property ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "equivalentProperty" ;+ rdfs:range rdf:Property .++owl:hasKey+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of properties that jointly build a key." ;+ rdfs:domain owl:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "hasKey" ;+ rdfs:range rdf:List .++owl:hasSelf+ a rdf:Property ;+ rdfs:comment "The property that determines the property that a self restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "hasSelf" ;+ rdfs:range rdfs:Resource .++owl:hasValue+ a rdf:Property ;+ rdfs:comment "The property that determines the individual that a has-value restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "hasValue" ;+ rdfs:range rdfs:Resource .++owl:imports+ a owl:OntologyProperty ;+ rdfs:comment "The property that is used for importing other ontologies into a given ontology." ;+ rdfs:domain owl:Ontology ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "imports" ;+ rdfs:range owl:Ontology .++owl:incompatibleWith+ a owl:AnnotationProperty, owl:OntologyProperty ;+ rdfs:comment "The annotation property that indicates that a given ontology is incompatible with another ontology." ;+ rdfs:domain owl:Ontology ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "incompatibleWith" ;+ rdfs:range owl:Ontology .++owl:intersectionOf+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of classes or data ranges that build an intersection." ;+ rdfs:domain rdfs:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "intersectionOf" ;+ rdfs:range rdf:List .++owl:inverseOf+ a rdf:Property ;+ rdfs:comment "The property that determines that two given properties are inverse." ;+ rdfs:domain owl:ObjectProperty ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "inverseOf" ;+ rdfs:range owl:ObjectProperty .++owl:maxCardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of a maximum cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "maxCardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:maxQualifiedCardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of a maximum qualified cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "maxQualifiedCardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:members+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of members in either a owl:AllDifferent, owl:AllDisjointClasses or owl:AllDisjointProperties axiom." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "members" ;+ rdfs:range rdf:List .++owl:minCardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of a minimum cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "minCardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:minQualifiedCardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of a minimum qualified cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "minQualifiedCardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:onClass+ a rdf:Property ;+ rdfs:comment "The property that determines the class that a qualified object cardinality restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "onClass" ;+ rdfs:range owl:Class .++owl:onDataRange+ a rdf:Property ;+ rdfs:comment "The property that determines the data range that a qualified data cardinality restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "onDataRange" ;+ rdfs:range rdfs:Datatype .++owl:onDatatype+ a rdf:Property ;+ rdfs:comment "The property that determines the datatype that a datatype restriction refers to." ;+ rdfs:domain rdfs:Datatype ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "onDatatype" ;+ rdfs:range rdfs:Datatype .++owl:onProperties+ a rdf:Property ;+ rdfs:comment "The property that determines the n-tuple of properties that a property restriction on an n-ary data range refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "onProperties" ;+ rdfs:range rdf:List .++owl:onProperty+ a rdf:Property ;+ rdfs:comment "The property that determines the property that a property restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "onProperty" ;+ rdfs:range rdf:Property .++owl:oneOf+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of individuals or data values that build an enumeration." ;+ rdfs:domain rdfs:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "oneOf" ;+ rdfs:range rdf:List .++owl:priorVersion+ a owl:AnnotationProperty, owl:OntologyProperty ;+ rdfs:comment "The annotation property that indicates the predecessor ontology of a given ontology." ;+ rdfs:domain owl:Ontology ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "priorVersion" ;+ rdfs:range owl:Ontology .++owl:propertyChainAxiom+ a rdf:Property ;+ rdfs:comment "The property that determines the n-tuple of properties that build a sub property chain of a given property." ;+ rdfs:domain owl:ObjectProperty ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "propertyChainAxiom" ;+ rdfs:range rdf:List .++owl:propertyDisjointWith+ a rdf:Property ;+ rdfs:comment "The property that determines that two given properties are disjoint." ;+ rdfs:domain rdf:Property ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "propertyDisjointWith" ;+ rdfs:range rdf:Property .++owl:qualifiedCardinality+ a rdf:Property ;+ rdfs:comment "The property that determines the cardinality of an exact qualified cardinality restriction." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "qualifiedCardinality" ;+ rdfs:range xsd:nonNegativeInteger .++owl:sameAs+ a rdf:Property ;+ rdfs:comment "The property that determines that two given individuals are equal." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "sameAs" ;+ rdfs:range owl:Thing .++owl:someValuesFrom+ a rdf:Property ;+ rdfs:comment "The property that determines the class that an existential property restriction refers to." ;+ rdfs:domain owl:Restriction ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "someValuesFrom" ;+ rdfs:range rdfs:Class .++owl:sourceIndividual+ a rdf:Property ;+ rdfs:comment "The property that determines the subject of a negative property assertion." ;+ rdfs:domain owl:NegativePropertyAssertion ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "sourceIndividual" ;+ rdfs:range owl:Thing .++owl:targetIndividual+ a rdf:Property ;+ rdfs:comment "The property that determines the object of a negative object property assertion." ;+ rdfs:domain owl:NegativePropertyAssertion ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "targetIndividual" ;+ rdfs:range owl:Thing .++owl:targetValue+ a rdf:Property ;+ rdfs:comment "The property that determines the value of a negative data property assertion." ;+ rdfs:domain owl:NegativePropertyAssertion ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "targetValue" ;+ rdfs:range rdfs:Literal .++owl:topDataProperty+ a owl:DatatypeProperty ;+ rdfs:comment "The data property that relates every individual to every data value." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "topDataProperty" ;+ rdfs:range rdfs:Literal .++owl:topObjectProperty+ a owl:ObjectProperty ;+ rdfs:comment "The object property that relates every two individuals." ;+ rdfs:domain owl:Thing ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "topObjectProperty" ;+ rdfs:range owl:Thing .++owl:unionOf+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of classes or data ranges that build a union." ;+ rdfs:domain rdfs:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "unionOf" ;+ rdfs:range rdf:List .++owl:versionIRI+ a owl:OntologyProperty ;+ rdfs:comment "The property that identifies the version IRI of an ontology." ;+ rdfs:domain owl:Ontology ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "versionIRI" ;+ rdfs:range owl:Ontology .++owl:versionInfo+ a owl:AnnotationProperty ;+ rdfs:comment "The annotation property that provides version information for an ontology or another OWL construct." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "versionInfo" ;+ rdfs:range rdfs:Resource .++owl:withRestrictions+ a rdf:Property ;+ rdfs:comment "The property that determines the collection of facet-value pairs that define a datatype restriction." ;+ rdfs:domain rdfs:Datatype ;+ rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;+ rdfs:label "withRestrictions" ;+ rdfs:range rdf:List .+
+ resources/rdf.ttl view
@@ -0,0 +1,144 @@+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .++<http://www.w3.org/1999/02/22-rdf-syntax-ns#>+ rdfs:comment "This is the RDF Schema for the RDF vocabulary terms in the RDF Namespace, defined in RDF 1.1 Concepts." ;+ rdfs:label "The RDF Concepts Vocabulary (RDF)" ;+ a owl:Ontology .++rdf:Alt+ a rdfs:Class ;+ rdfs:comment "The class of containers of alternatives." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "Alt" ;+ rdfs:subClassOf rdfs:Container .++rdf:Bag+ a rdfs:Class ;+ rdfs:comment "The class of unordered containers." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "Bag" ;+ rdfs:subClassOf rdfs:Container .++rdf:HTML+ a rdfs:Datatype ;+ rdfs:comment "The datatype of RDF literals storing fragments of HTML content" ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "HTML" ;+ rdfs:seeAlso <http://www.w3.org/TR/rdf11-concepts/#section-html> ;+ rdfs:subClassOf rdfs:Literal .++rdf:List+ a rdfs:Class ;+ rdfs:comment "The class of RDF Lists." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "List" ;+ rdfs:subClassOf rdfs:Resource .++rdf:PlainLiteral+ a rdfs:Datatype ;+ rdfs:comment "The class of plain (i.e. untyped) literal values, as used in RIF and OWL 2" ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "PlainLiteral" ;+ rdfs:seeAlso <http://www.w3.org/TR/rdf-plain-literal/> ;+ rdfs:subClassOf rdfs:Literal .++rdf:Property+ a rdfs:Class ;+ rdfs:comment "The class of RDF properties." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "Property" ;+ rdfs:subClassOf rdfs:Resource .++rdf:Seq+ a rdfs:Class ;+ rdfs:comment "The class of ordered containers." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "Seq" ;+ rdfs:subClassOf rdfs:Container .++rdf:Statement+ a rdfs:Class ;+ rdfs:comment "The class of RDF statements." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "Statement" ;+ rdfs:subClassOf rdfs:Resource .++rdf:XMLLiteral+ a rdfs:Datatype ;+ rdfs:comment "The datatype of XML literal values." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "XMLLiteral" ;+ rdfs:subClassOf rdfs:Literal .++rdf:first+ a rdf:Property ;+ rdfs:comment "The first item in the subject RDF list." ;+ rdfs:domain rdf:List ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "first" ;+ rdfs:range rdfs:Resource .++rdf:langString+ a rdfs:Datatype ;+ rdfs:comment "The datatype of language-tagged string values" ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "langString" ;+ rdfs:seeAlso <http://www.w3.org/TR/rdf11-concepts/#section-Graph-Literal> ;+ rdfs:subClassOf rdfs:Literal .++rdf:nil+ a rdf:List ;+ rdfs:comment "The empty list, with no items in it. If the rest of a list is nil then the list has no more items in it." ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "nil" .++rdf:object+ a rdf:Property ;+ rdfs:comment "The object of the subject RDF statement." ;+ rdfs:domain rdf:Statement ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "object" ;+ rdfs:range rdfs:Resource .++rdf:predicate+ a rdf:Property ;+ rdfs:comment "The predicate of the subject RDF statement." ;+ rdfs:domain rdf:Statement ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "predicate" ;+ rdfs:range rdfs:Resource .++rdf:rest+ a rdf:Property ;+ rdfs:comment "The rest of the subject RDF list after the first item." ;+ rdfs:domain rdf:List ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "rest" ;+ rdfs:range rdf:List .++rdf:subject+ a rdf:Property ;+ rdfs:comment "The subject of the subject RDF statement." ;+ rdfs:domain rdf:Statement ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "subject" ;+ rdfs:range rdfs:Resource .++rdf:type+ a rdf:Property ;+ rdfs:comment "The subject is an instance of a class." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "type" ;+ rdfs:range rdfs:Class .++rdf:value+ a rdf:Property ;+ rdfs:comment "Idiomatic property used for structured values." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/1999/02/22-rdf-syntax-ns#> ;+ rdfs:label "value" ;+ rdfs:range rdfs:Resource .+
+ resources/rdfs.ttl view
@@ -0,0 +1,125 @@+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix owl: <http://www.w3.org/2002/07/owl#> .++<http://www.w3.org/2000/01/rdf-schema#>+ rdfs:label "The RDF Schema vocabulary (RDFS)" ;+ a owl:Ontology ;+ <http://purl.org/vocab/vann/preferredNamespaceUri> "http://www.w3.org/2000/01/rdf-schema#";+ rdfs:seeAlso <http://www.w3.org/2000/01/rdf-schema-more> .++rdfs:Class+ a rdfs:Class ;+ rdfs:comment "The class of classes." ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "Class" ;+ rdfs:subClassOf rdfs:Resource .++rdfs:Container+ a rdfs:Class ;+ rdfs:comment "The class of RDF containers." ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "Container" ;+ rdfs:subClassOf rdfs:Resource .++rdfs:ContainerMembershipProperty+ a rdfs:Class ;+ rdfs:comment """The class of container membership properties, rdf:_1, rdf:_2, ...,+ all of which are sub-properties of 'member'.""" ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "ContainerMembershipProperty" ;+ rdfs:subClassOf rdf:Property .++rdfs:Datatype+ a rdfs:Class ;+ rdfs:comment "The class of RDF datatypes." ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "Datatype" ;+ rdfs:subClassOf rdfs:Class .++rdfs:Literal+ a rdfs:Class ;+ rdfs:comment "The class of literal values, eg. textual strings and integers." ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "Literal" ;+ rdfs:subClassOf rdfs:Resource .++rdfs:Resource+ a rdfs:Class ;+ rdfs:comment "The class resource, everything." ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "Resource" .++rdfs:comment+ a rdf:Property ;+ rdfs:comment "A description of the subject resource." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "comment" ;+ rdfs:range rdfs:Literal .++rdfs:domain+ a rdf:Property ;+ rdfs:comment "A domain of the subject property." ;+ rdfs:domain rdf:Property ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "domain" ;+ rdfs:range rdfs:Class .++rdfs:isDefinedBy+ a rdf:Property ;+ rdfs:comment "The defininition of the subject resource." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "isDefinedBy" ;+ rdfs:range rdfs:Resource ;+ rdfs:subPropertyOf rdfs:seeAlso .++rdfs:label+ a rdf:Property ;+ rdfs:comment "A human-readable name for the subject." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "label" ;+ rdfs:range rdfs:Literal .++rdfs:member+ a rdf:Property ;+ rdfs:comment "A member of the subject resource." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "member" ;+ rdfs:range rdfs:Resource .++rdfs:range+ a rdf:Property ;+ rdfs:comment "A range of the subject property." ;+ rdfs:domain rdf:Property ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "range" ;+ rdfs:range rdfs:Class .++rdfs:seeAlso+ a rdf:Property ;+ rdfs:comment "Further information about the subject resource." ;+ rdfs:domain rdfs:Resource ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "seeAlso" ;+ rdfs:range rdfs:Resource .++rdfs:subClassOf+ a rdf:Property ;+ rdfs:comment "The subject is a subclass of a class." ;+ rdfs:domain rdfs:Class ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "subClassOf" ;+ rdfs:range rdfs:Class .++rdfs:subPropertyOf+ a rdf:Property ;+ rdfs:comment "The subject is a subproperty of a property." ;+ rdfs:domain rdf:Property ;+ rdfs:isDefinedBy <http://www.w3.org/2000/01/rdf-schema#> ;+ rdfs:label "subPropertyOf" ;+ rdfs:range rdf:Property .+
+ resources/shacl.ttl view
@@ -0,0 +1,1462 @@+# W3C Shapes Constraint Language (SHACL) Vocabulary+# Draft last edited 2017-04-13++@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .++@prefix sh: <http://www.w3.org/ns/shacl#> .++sh:+ a owl:Ontology ;+ rdfs:label "W3C Shapes Constraint Language (SHACL) Vocabulary"@en ;+ rdfs:comment "This vocabulary defines terms used in SHACL, the W3C Shapes Constraint Language."@en ;+ sh:declare [+ sh:prefix "sh" ;+ sh:namespace "http://www.w3.org/ns/shacl#" ;+ ] ;+ sh:suggestedShapesGraph <http://www.w3.org/ns/shacl-shacl#> .+++# Shapes vocabulary -----------------------------------------------------------++sh:Shape+ a rdfs:Class ;+ rdfs:label "Shape"@en ;+ rdfs:comment "A shape is a collection of constraints that may be targeted for certain nodes."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:NodeShape+ a rdfs:Class ;+ rdfs:label "Node shape"@en ;+ rdfs:comment "A node shape is a shape that specifies constraint that need to be met with respect to focus nodes."@en ;+ rdfs:subClassOf sh:Shape ;+ rdfs:isDefinedBy sh: .++sh:PropertyShape+ a rdfs:Class ;+ rdfs:label "Property shape"@en ;+ rdfs:comment "A property shape is a shape that specifies constraints on the values of a focus node for a given property or path."@en ;+ rdfs:subClassOf sh:Shape ;+ rdfs:isDefinedBy sh: .++sh:deactivated+ a rdf:Property ;+ rdfs:label "deactivated"@en ;+ rdfs:comment "If set to true for a shape then the shape is deactivated and all nodes conform to it."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .++sh:target+ a rdf:Property ;+ rdfs:label "target"@en ;+ rdfs:comment "Links a shape to a target specified by an extension language, for example instances of sh:SPARQLTarget."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range sh:Target ;+ rdfs:isDefinedBy sh: .++sh:targetClass + a rdf:Property ;+ rdfs:label "target class"@en ;+ rdfs:comment "Links a shape to a class, indicating that all instances of the class must conform to the shape."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range rdfs:Class ;+ rdfs:isDefinedBy sh: .++sh:targetNode + a rdf:Property ;+ rdfs:label "target node"@en ;+ rdfs:comment "Links a shape to individual nodes, indicating that these nodes must conform to the shape."@en ;+ rdfs:domain sh:Shape ;+ rdfs:isDefinedBy sh: .++sh:targetObjectsOf+ a rdf:Property ;+ rdfs:label "target objects of"@en ;+ rdfs:comment "Links a shape to a property, indicating that all all objects of triples that have the given property as their predicate must conform to the shape."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .++sh:targetSubjectsOf+ a rdf:Property ;+ rdfs:label "target subjects of"@en ;+ rdfs:comment "Links a shape to a property, indicating that all subjects of triples that have the given property as their predicate must conform to the shape."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .++sh:message+ a rdf:Property ;+ # domain: sh:Shape or sh:SPARQLConstraint or sh:SPARQLSelectValidator or sh:SPARQLAskValidator+ # range: xsd:string or rdf:langString+ rdfs:label "message"@en ;+ rdfs:comment "A human-readable message (possibly with placeholders for variables) explaining the cause of the result."@en ;+ rdfs:isDefinedBy sh: .++sh:severity+ a rdf:Property ;+ rdfs:label "severity"@en ;+ rdfs:comment "Defines the severity that validation results produced by a shape must have. Defaults to sh:Violation."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range sh:Severity ;+ rdfs:isDefinedBy sh: .+++# Node kind vocabulary --------------------------------------------------------++sh:NodeKind+ a rdfs:Class ;+ rdfs:label "Node kind"@en ;+ rdfs:comment "The class of all node kinds, including sh:BlankNode, sh:IRI, sh:Literal or the combinations of these: sh:BlankNodeOrIRI, sh:BlankNodeOrLiteral, sh:IRIOrLiteral."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:BlankNode+ a sh:NodeKind ;+ rdfs:label "Blank node"@en ;+ rdfs:comment "The node kind of all blank nodes."@en ;+ rdfs:isDefinedBy sh: .++sh:BlankNodeOrIRI+ a sh:NodeKind ;+ rdfs:label "Blank node or IRI"@en ;+ rdfs:comment "The node kind of all blank nodes or IRIs."@en ;+ rdfs:isDefinedBy sh: .++sh:BlankNodeOrLiteral+ a sh:NodeKind ;+ rdfs:label "Blank node or literal"@en ;+ rdfs:comment "The node kind of all blank nodes or literals."@en ;+ rdfs:isDefinedBy sh: .++sh:IRI+ a sh:NodeKind ;+ rdfs:label "IRI"@en ;+ rdfs:comment "The node kind of all IRIs."@en ;+ rdfs:isDefinedBy sh: .++sh:IRIOrLiteral+ a sh:NodeKind ;+ rdfs:label "IRI or literal"@en ;+ rdfs:comment "The node kind of all IRIs or literals."@en ;+ rdfs:isDefinedBy sh: .++sh:Literal+ a sh:NodeKind ;+ rdfs:label "Literal"@en ;+ rdfs:comment "The node kind of all literals."@en ;+ rdfs:isDefinedBy sh: .+++# Results vocabulary ----------------------------------------------------------++sh:ValidationReport+ a rdfs:Class ;+ rdfs:label "Validation report"@en ;+ rdfs:comment "The class of SHACL validation reports."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:conforms+ a rdf:Property ;+ rdfs:label "conforms"@en ;+ rdfs:comment "True if the validation did not produce any validation results, and false otherwise."@en ;+ rdfs:domain sh:ValidationReport ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .++sh:result+ a rdf:Property ;+ rdfs:label "result"@en ;+ rdfs:comment "The validation results contained in a validation report."@en ;+ rdfs:domain sh:ValidationReport ;+ rdfs:range sh:ValidationResult ;+ rdfs:isDefinedBy sh: .++sh:shapesGraphWellFormed+ a rdf:Property ;+ rdfs:label "shapes graph well-formed"@en ;+ rdfs:comment "If true then the validation engine was certain that the shapes graph has passed all SHACL syntax requirements during the validation process."@en ;+ rdfs:domain sh:ValidationReport ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .++sh:AbstractResult+ a rdfs:Class ;+ rdfs:label "Abstract result"@en ;+ rdfs:comment "The base class of validation results, typically not instantiated directly."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:ValidationResult+ a rdfs:Class ;+ rdfs:label "Validation result"@en ;+ rdfs:comment "The class of validation results."@en ;+ rdfs:subClassOf sh:AbstractResult ;+ rdfs:isDefinedBy sh: .++sh:Severity+ a rdfs:Class ;+ rdfs:label "Severity"@en ;+ rdfs:comment "The class of validation result severity levels, including violation and warning levels."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:Info+ a sh:Severity ;+ rdfs:label "Info"@en ;+ rdfs:comment "The severity for an informational validation result."@en ;+ rdfs:isDefinedBy sh: .++sh:Violation+ a sh:Severity ;+ rdfs:label "Violation"@en ;+ rdfs:comment "The severity for a violation validation result."@en ;+ rdfs:isDefinedBy sh: .++sh:Warning+ a sh:Severity ;+ rdfs:label "Warning"@en ;+ rdfs:comment "The severity for a warning validation result."@en ;+ rdfs:isDefinedBy sh: .++sh:detail+ a rdf:Property ;+ rdfs:label "detail"@en ;+ rdfs:comment "Links a result with other results that provide more details, for example to describe violations against nested shapes."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:range sh:AbstractResult ;+ rdfs:isDefinedBy sh: .++sh:focusNode+ a rdf:Property ;+ rdfs:label "focus node"@en ;+ rdfs:comment "The focus node that was validated when the result was produced."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:isDefinedBy sh: .++sh:resultMessage+ a rdf:Property ;+ rdfs:label "result message"@en ;+ rdfs:comment "Human-readable messages explaining the cause of the result."@en ;+ rdfs:domain sh:AbstractResult ;+ # range: xsd:string or rdf:langString+ rdfs:isDefinedBy sh: .++sh:resultPath+ a rdf:Property ;+ rdfs:label "result path"@en ;+ rdfs:comment "The path of a validation result, based on the path of the validated property shape."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:resultSeverity+ a rdf:Property ;+ rdfs:label "result severity"@en ;+ rdfs:comment "The severity of the result, e.g. warning."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:range sh:Severity ;+ rdfs:isDefinedBy sh: .++sh:sourceConstraint+ a rdf:Property ;+ rdfs:label "source constraint"@en ;+ rdfs:comment "The constraint that was validated when the result was produced."@en ;+ rdfs:domain sh:AbstractResult ;+ # rdfs:range sh:SPARQLConstraint ;+ rdfs:isDefinedBy sh: .++sh:sourceShape+ a rdf:Property ;+ rdfs:label "source shape"@en ;+ rdfs:comment "The shape that is was validated when the result was produced."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:range sh:Shape ;+ rdfs:isDefinedBy sh: .++sh:sourceConstraintComponent+ a rdf:Property ;+ rdfs:label "source constraint component"@en ;+ rdfs:comment "The constraint component that is the source of the result."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:range sh:ConstraintComponent ;+ rdfs:isDefinedBy sh: .++sh:value+ a rdf:Property ;+ rdfs:label "value"@en ;+ rdfs:comment "An RDF node that has caused the result."@en ;+ rdfs:domain sh:AbstractResult ;+ rdfs:isDefinedBy sh: .+++# SPARQL execution support ----------------------------------------------------++sh:SPARQLExecutable+ a rdfs:Class ;+ rdfs:label "SPARQL executable"@en ;+ rdfs:comment "The class of resources that encapsulate a SPARQL query."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:SPARQLAskExecutable+ a rdfs:Class ;+ rdfs:label "SPARQL ASK executable"@en ;+ rdfs:comment "The class of SPARQL executables that are based on an ASK query."@en ;+ rdfs:subClassOf sh:SPARQLExecutable ;+ rdfs:isDefinedBy sh: .++sh:ask+ a rdf:Property ;+ rdfs:label "ask"@en ;+ rdfs:comment "The SPARQL ASK query to execute."@en ;+ rdfs:domain sh:SPARQLAskExecutable ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .++sh:SPARQLConstructExecutable+ a rdfs:Class ;+ rdfs:label "SPARQL CONSTRUCT executable"@en ;+ rdfs:comment "The class of SPARQL executables that are based on a CONSTRUCT query."@en ;+ rdfs:subClassOf sh:SPARQLExecutable ;+ rdfs:isDefinedBy sh: .++sh:construct+ a rdf:Property ;+ rdfs:label "construct"@en ;+ rdfs:comment "The SPARQL CONSTRUCT query to execute."@en ;+ rdfs:domain sh:SPARQLConstructExecutable ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .++sh:SPARQLSelectExecutable+ a rdfs:Class ;+ rdfs:label "SPARQL SELECT executable"@en ;+ rdfs:comment "The class of SPARQL executables based on a SELECT query."@en ;+ rdfs:subClassOf sh:SPARQLExecutable ;+ rdfs:isDefinedBy sh: .++sh:select+ a rdf:Property ;+ rdfs:label "select"@en ;+ rdfs:comment "The SPARQL SELECT query to execute."@en ;+ rdfs:range xsd:string ;+ rdfs:domain sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .++sh:SPARQLUpdateExecutable+ a rdfs:Class ;+ rdfs:label "SPARQL UPDATE executable"@en ;+ rdfs:comment "The class of SPARQL executables based on a SPARQL UPDATE."@en ;+ rdfs:subClassOf sh:SPARQLExecutable ;+ rdfs:isDefinedBy sh: .++sh:update+ a rdf:Property ;+ rdfs:label "update"@en ;+ rdfs:comment "The SPARQL UPDATE to execute."@en ;+ rdfs:domain sh:SPARQLUpdateExecutable ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .++sh:prefixes+ a rdf:Property ;+ rdfs:label "prefixes"@en ;+ rdfs:comment "The prefixes that shall be applied before parsing the associated SPARQL query."@en ;+ rdfs:domain sh:SPARQLExecutable ;+ rdfs:range owl:Ontology ;+ rdfs:isDefinedBy sh: .++sh:PrefixDeclaration+ a rdfs:Class ;+ rdfs:label "Prefix declaration"@en ;+ rdfs:comment "The class of prefix declarations, consisting of pairs of a prefix with a namespace."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:declare+ a rdf:Property ;+ rdfs:label "declare"@en ;+ rdfs:comment "Links a resource with its namespace prefix declarations."@en ;+ rdfs:domain owl:Ontology ;+ rdfs:range sh:PrefixDeclaration ;+ rdfs:isDefinedBy sh: .++sh:prefix+ a rdf:Property ;+ rdfs:label "prefix"@en ;+ rdfs:comment "The prefix of a prefix declaration."@en ;+ rdfs:domain sh:PrefixDeclaration ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .++sh:namespace+ a rdf:Property ;+ rdfs:label "namespace"@en ;+ rdfs:comment "The namespace associated with a prefix in a prefix declaration."@en ;+ rdfs:domain sh:PrefixDeclaration ;+ rdfs:range xsd:anyURI ;+ rdfs:isDefinedBy sh: .++sh:shapesGraph+ a rdf:Property ;+ rdfs:label "shapes graph"@en ;+ rdfs:comment "Shapes graphs that should be used when validating this data graph."@en ;+ rdfs:domain owl:Ontology ;+ rdfs:range owl:Ontology ;+ rdfs:isDefinedBy sh: .++sh:suggestedShapesGraph+ a rdf:Property ;+ rdfs:label "suggested shapes graph"@en ;+ rdfs:comment "Suggested shapes graphs for this ontology. The values of this property may be used in the absence of specific sh:shapesGraph statements."@en ;+ rdfs:domain owl:Ontology ;+ rdfs:range owl:Ontology ;+ rdfs:isDefinedBy sh: .+ ++# Target vocabulary -----------------------------------------------------------++sh:Target+ a rdfs:Class ;+ rdfs:label "Target"@en ;+ rdfs:comment "The base class of targets such as those based on SPARQL queries."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:SPARQLTarget+ a rdfs:Class ;+ rdfs:label "SPARQL target"@en ;+ rdfs:comment "The class of targets that are based on SPARQL SELECT queries."@en ;+ rdfs:subClassOf sh:Target ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .++sh:TargetType+ a rdfs:Class ;+ rdfs:label "Target type"@en ;+ rdfs:comment "The (meta) class for parameterizable targets. Instances of this are instantiated as values of the sh:target property."@en ;+ rdfs:subClassOf rdfs:Class ;+ rdfs:subClassOf sh:Parameterizable ;+ rdfs:isDefinedBy sh: .++sh:SPARQLTargetType+ a rdfs:Class ;+ rdfs:label "SPARQL target type"@en ;+ rdfs:comment "The (meta) class for parameterizable targets that are based on SPARQL SELECT queries."@en ;+ rdfs:subClassOf sh:TargetType ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .+++# Path vocabulary -------------------------------------------------------------++sh:path+ a rdf:Property ;+ rdfs:label "path"@en ;+ rdfs:comment "Specifies the property path of a property shape."@en ;+ rdfs:domain sh:PropertyShape ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:inversePath+ a rdf:Property ;+ rdfs:label "inverse path"@en ;+ rdfs:comment "The (single) value of this property represents an inverse path (object to subject)."@en ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:alternativePath+ a rdf:Property ;+ rdfs:label "alternative path"@en ;+ rdfs:comment "The (single) value of this property must be a list of path elements, representing the elements of alternative paths."@en ;+ rdfs:range rdf:List ;+ rdfs:isDefinedBy sh: .++sh:zeroOrMorePath+ a rdf:Property ;+ rdfs:label "zero or more path"@en ;+ rdfs:comment "The (single) value of this property represents a path that is matched zero or more times."@en ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:oneOrMorePath+ a rdf:Property ;+ rdfs:label "one or more path"@en ;+ rdfs:comment "The (single) value of this property represents a path that is matched one or more times."@en ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:zeroOrOnePath+ a rdf:Property ;+ rdfs:label "zero or one path"@en ;+ rdfs:comment "The (single) value of this property represents a path that is matched zero or one times."@en ;+ rdfs:range rdfs:Resource ;+ rdfs:isDefinedBy sh: .+++# Parameters metamodel --------------------------------------------------------++sh:Parameterizable+ a rdfs:Class ;+ rdfs:label "Parameterizable"@en ;+ rdfs:comment "Superclass of components that can take parameters, especially functions and constraint components."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:parameter+ a rdf:Property ;+ rdfs:label "parameter"@en ;+ rdfs:comment "The parameters of a function or constraint component."@en ;+ rdfs:domain sh:Parameterizable ;+ rdfs:range sh:Parameter ;+ rdfs:isDefinedBy sh: .++sh:labelTemplate+ a rdf:Property ;+ rdfs:label "label template"@en ;+ rdfs:comment "Outlines how human-readable labels of instances of the associated Parameterizable shall be produced. The values can contain {?paramName} as placeholders for the actual values of the given parameter."@en ;+ rdfs:domain sh:Parameterizable ;+ # range: xsd:string or rdf:langString+ rdfs:isDefinedBy sh: .++sh:Parameter+ a rdfs:Class ;+ rdfs:label "Parameter"@en ;+ rdfs:comment "The class of parameter declarations, consisting of a path predicate and (possibly) information about allowed value type, cardinality and other characteristics."@en ;+ rdfs:subClassOf sh:PropertyShape ;+ rdfs:isDefinedBy sh: .++sh:optional+ a rdf:Property ;+ rdfs:label "optional"@en ;+ rdfs:comment "Indicates whether a parameter is optional."@en ;+ rdfs:domain sh:Parameter ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .+++# Constraint components metamodel ---------------------------------------------++sh:ConstraintComponent+ a rdfs:Class ;+ rdfs:label "Constraint component"@en ;+ rdfs:comment "The class of constraint components."@en ;+ rdfs:subClassOf sh:Parameterizable ;+ rdfs:isDefinedBy sh: .++sh:validator+ a rdf:Property ;+ rdfs:label "validator"@en ;+ rdfs:comment "The validator(s) used to evaluate constraints of either node or property shapes."@en ;+ rdfs:domain sh:ConstraintComponent ;+ rdfs:range sh:Validator ;+ rdfs:isDefinedBy sh: .++sh:nodeValidator+ a rdf:Property ;+ rdfs:label "shape validator"@en ;+ rdfs:comment "The validator(s) used to evaluate a constraint in the context of a node shape."@en ;+ rdfs:domain sh:ConstraintComponent ;+ rdfs:range sh:Validator ;+ rdfs:isDefinedBy sh: .++sh:propertyValidator+ a rdf:Property ;+ rdfs:label "property validator"@en ;+ rdfs:comment "The validator(s) used to evaluate a constraint in the context of a property shape."@en ;+ rdfs:domain sh:ConstraintComponent ;+ rdfs:range sh:Validator ;+ rdfs:isDefinedBy sh: .++sh:Validator+ a rdfs:Class ;+ rdfs:label "Validator"@en ;+ rdfs:comment "The class of validators, which provide instructions on how to process a constraint definition. This class serves as base class for the SPARQL-based validators and other possible implementations."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:SPARQLAskValidator+ a rdfs:Class ;+ rdfs:label "SPARQL ASK validator"@en ;+ rdfs:comment "The class of validators based on SPARQL ASK queries. The queries are evaluated for each value node and are supposed to return true if the given node conforms."@en ;+ rdfs:subClassOf sh:Validator ;+ rdfs:subClassOf sh:SPARQLAskExecutable ;+ rdfs:isDefinedBy sh: .++sh:SPARQLSelectValidator+ a rdfs:Class ;+ rdfs:label "SPARQL SELECT validator"@en ;+ rdfs:comment "The class of validators based on SPARQL SELECT queries. The queries are evaluated for each focus node and are supposed to produce bindings for all focus nodes that do not conform."@en ;+ rdfs:subClassOf sh:Validator ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .+++# Library of Core Constraint Components and their properties ------------------++sh:AndConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "And constraint component"@en ;+ rdfs:comment "A constraint component that can be used to test whether a value node conforms to all members of a provided list of shapes."@en ;+ sh:parameter sh:AndConstraintComponent-and ;+ rdfs:isDefinedBy sh: .++sh:AndConstraintComponent-and+ a sh:Parameter ;+ sh:path sh:and ;+ rdfs:isDefinedBy sh: .++sh:and+ a rdf:Property ;+ rdfs:label "and"@en ;+ rdfs:comment "RDF list of shapes to validate the value nodes against."@en ;+ rdfs:range rdf:List ;+ rdfs:isDefinedBy sh: .+++sh:ClassConstraintComponent + a sh:ConstraintComponent ;+ rdfs:label "Class constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that each value node is an instance of a given type."@en ;+ sh:parameter sh:ClassConstraintComponent-class ;+ rdfs:isDefinedBy sh: .++sh:ClassConstraintComponent-class+ a sh:Parameter ;+ sh:path sh:class ;+ sh:nodeKind sh:IRI ;+ rdfs:isDefinedBy sh: .++sh:class+ a rdf:Property ;+ rdfs:label "class"@en ;+ rdfs:comment "The type that all value nodes must have."@en ;+ rdfs:range rdfs:Class ;+ rdfs:isDefinedBy sh: .+++sh:ClosedConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Closed constraint component"@en ;+ rdfs:comment "A constraint component that can be used to indicate that focus nodes must only have values for those properties that have been explicitly enumerated via sh:property/sh:path."@en ;+ sh:parameter sh:ClosedConstraintComponent-closed ;+ sh:parameter sh:ClosedConstraintComponent-ignoredProperties ;+ rdfs:isDefinedBy sh: .++sh:ClosedConstraintComponent-closed+ a sh:Parameter ; + sh:path sh:closed ;+ sh:datatype xsd:boolean ;+ rdfs:isDefinedBy sh: .++sh:ClosedConstraintComponent-ignoredProperties+ a sh:Parameter ;+ sh:path sh:ignoredProperties ;+ sh:optional true ;+ rdfs:isDefinedBy sh: .++sh:closed+ a rdf:Property ;+ rdfs:label "closed"@en ;+ rdfs:comment "If set to true then the shape is closed."@en ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .++sh:ignoredProperties+ a rdf:Property ;+ rdfs:label "ignored properties"@en ;+ rdfs:comment "An optional RDF list of properties that are also permitted in addition to those explicitly enumerated via sh:property/sh:path."@en ;+ rdfs:range rdf:List ; # members: rdf:Property+ rdfs:isDefinedBy sh: .+++sh:DatatypeConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Datatype constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the datatype of all value nodes."@en ;+ sh:parameter sh:DatatypeConstraintComponent-datatype ;+ rdfs:isDefinedBy sh: .++sh:DatatypeConstraintComponent-datatype+ a sh:Parameter ;+ sh:path sh:datatype ;+ sh:nodeKind sh:IRI ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:datatype+ a rdf:Property ;+ rdfs:label "datatype"@en ;+ rdfs:comment "Specifies an RDF datatype that all value nodes must have."@en ;+ rdfs:range rdfs:Datatype ;+ rdfs:isDefinedBy sh: .+++sh:DisjointConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Disjoint constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that the set of value nodes is disjoint with the the set of nodes that have the focus node as subject and the value of a given property as predicate."@en ;+ sh:parameter sh:DisjointConstraintComponent-disjoint ;+ rdfs:isDefinedBy sh: .++sh:DisjointConstraintComponent-disjoint+ a sh:Parameter ;+ sh:path sh:disjoint ;+ sh:nodeKind sh:IRI ;+ rdfs:isDefinedBy sh: .++sh:disjoint+ a rdf:Property ;+ rdfs:label "disjoint"@en ;+ rdfs:comment "Specifies a property where the set of values must be disjoint with the value nodes."@en ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .+++sh:EqualsConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Equals constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that the set of value nodes is equal to the set of nodes that have the focus node as subject and the value of a given property as predicate."@en ;+ sh:parameter sh:EqualsConstraintComponent-equals ;+ rdfs:isDefinedBy sh: .++sh:EqualsConstraintComponent-equals+ a sh:Parameter ;+ sh:path sh:equals ;+ sh:nodeKind sh:IRI ;+ rdfs:isDefinedBy sh: .++sh:equals+ a rdf:Property ;+ rdfs:label "equals"@en ;+ rdfs:comment "Specifies a property that must have the same values as the value nodes."@en ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .+++sh:HasValueConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Has-value constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that one of the value nodes is a given RDF node."@en ;+ sh:parameter sh:HasValueConstraintComponent-hasValue ;+ rdfs:isDefinedBy sh: .++sh:HasValueConstraintComponent-hasValue+ a sh:Parameter ;+ sh:path sh:hasValue ;+ rdfs:isDefinedBy sh: .++sh:hasValue+ a rdf:Property ;+ rdfs:label "has value"@en ;+ rdfs:comment "Specifies a value that must be among the value nodes."@en ;+ rdfs:isDefinedBy sh: .+++sh:InConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "In constraint component"@en ;+ rdfs:comment "A constraint component that can be used to exclusively enumerate the permitted value nodes."@en ;+ sh:parameter sh:InConstraintComponent-in ;+ rdfs:isDefinedBy sh: .++sh:InConstraintComponent-in+ a sh:Parameter ;+ sh:path sh:in ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:in+ a rdf:Property ;+ rdfs:label "in"@en ;+ rdfs:comment "Specifies a list of allowed values so that each value node must be among the members of the given list."@en ;+ rdfs:range rdf:List ;+ rdfs:isDefinedBy sh: .+++sh:LanguageInConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Language-in constraint component"@en ;+ rdfs:comment "A constraint component that can be used to enumerate language tags that all value nodes must have."@en ;+ sh:parameter sh:LanguageInConstraintComponent-languageIn ;+ rdfs:isDefinedBy sh: .++sh:LanguageInConstraintComponent-languageIn+ a sh:Parameter ;+ sh:path sh:languageIn ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:languageIn+ a rdf:Property ;+ rdfs:label "language in"@en ;+ rdfs:comment "Specifies a list of language tags that all value nodes must have."@en ;+ rdfs:range rdf:List ; # members: xsd:string+ rdfs:isDefinedBy sh: .+++sh:LessThanConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Less-than constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that each value node is smaller than all the nodes that have the focus node as subject and the value of a given property as predicate."@en ;+ sh:parameter sh:LessThanConstraintComponent-lessThan ;+ rdfs:isDefinedBy sh: .++sh:LessThanConstraintComponent-lessThan+ a sh:Parameter ;+ sh:path sh:lessThan ;+ sh:nodeKind sh:IRI ;+ rdfs:isDefinedBy sh: .++sh:lessThan+ a rdf:Property ;+ rdfs:label "less than"@en ;+ rdfs:comment "Specifies a property that must have smaller values than the value nodes."@en ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .+++sh:LessThanOrEqualsConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "less-than-or-equals constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that every value node is smaller than all the nodes that have the focus node as subject and the value of a given property as predicate."@en ;+ sh:parameter sh:LessThanOrEqualsConstraintComponent-lessThanOrEquals ;+ rdfs:isDefinedBy sh: .++sh:LessThanOrEqualsConstraintComponent-lessThanOrEquals+ a sh:Parameter ;+ sh:path sh:lessThanOrEquals ;+ sh:nodeKind sh:IRI ;+ rdfs:isDefinedBy sh: .++sh:lessThanOrEquals+ a rdf:Property ;+ rdfs:label "less than or equals"@en ;+ rdfs:comment "Specifies a property that must have smaller or equal values than the value nodes."@en ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .+++sh:MaxCountConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Max-count constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the maximum number of value nodes."@en ;+ sh:parameter sh:MaxCountConstraintComponent-maxCount ;+ rdfs:isDefinedBy sh: .++sh:MaxCountConstraintComponent-maxCount+ a sh:Parameter ;+ sh:path sh:maxCount ;+ sh:datatype xsd:integer ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:maxCount+ a rdf:Property ;+ rdfs:label "max count"@en ;+ rdfs:comment "Specifies the maximum number of values in the set of value nodes."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .+++sh:MaxExclusiveConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Max-exclusive constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the range of value nodes with a maximum exclusive value."@en ;+ sh:parameter sh:MaxExclusiveConstraintComponent-maxExclusive ;+ rdfs:isDefinedBy sh: .++sh:MaxExclusiveConstraintComponent-maxExclusive+ a sh:Parameter ;+ sh:path sh:maxExclusive ;+ sh:maxCount 1 ;+ sh:nodeKind sh:Literal ;+ rdfs:isDefinedBy sh: .++sh:maxExclusive+ a rdf:Property ;+ rdfs:label "max exclusive"@en ;+ rdfs:comment "Specifies the maximum exclusive value of each value node."@en ;+ rdfs:isDefinedBy sh: .+++sh:MaxInclusiveConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Max-inclusive constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the range of value nodes with a maximum inclusive value."@en ;+ sh:parameter sh:MaxInclusiveConstraintComponent-maxInclusive ;+ rdfs:isDefinedBy sh: .++sh:MaxInclusiveConstraintComponent-maxInclusive+ a sh:Parameter ;+ sh:path sh:maxInclusive ;+ sh:maxCount 1 ;+ sh:nodeKind sh:Literal ;+ rdfs:isDefinedBy sh: .++sh:maxInclusive+ a rdf:Property ;+ rdfs:label "max inclusive"@en ;+ rdfs:comment "Specifies the maximum inclusive value of each value node."@en ;+ rdfs:isDefinedBy sh: .+++sh:MaxLengthConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Max-length constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the maximum string length of value nodes."@en ;+ sh:parameter sh:MaxLengthConstraintComponent-maxLength ;+ rdfs:isDefinedBy sh: .++sh:MaxLengthConstraintComponent-maxLength+ a sh:Parameter ;+ sh:path sh:maxLength ;+ sh:datatype xsd:integer ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:maxLength+ a rdf:Property ;+ rdfs:label "max length"@en ;+ rdfs:comment "Specifies the maximum string length of each value node."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .+++sh:MinCountConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Min-count constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the minimum number of value nodes."@en ;+ sh:parameter sh:MinCountConstraintComponent-minCount ;+ rdfs:isDefinedBy sh: .++sh:MinCountConstraintComponent-minCount+ a sh:Parameter ;+ sh:path sh:minCount ;+ sh:datatype xsd:integer ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:minCount+ a rdf:Property ;+ rdfs:label "min count"@en ;+ rdfs:comment "Specifies the minimum number of values in the set of value nodes."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .+++sh:MinExclusiveConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Min-exclusive constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the range of value nodes with a minimum exclusive value."@en ;+ sh:parameter sh:MinExclusiveConstraintComponent-minExclusive ;+ rdfs:isDefinedBy sh: .++sh:MinExclusiveConstraintComponent-minExclusive+ a sh:Parameter ;+ sh:path sh:minExclusive ;+ sh:maxCount 1 ;+ sh:nodeKind sh:Literal ;+ rdfs:isDefinedBy sh: .++sh:minExclusive+ a rdf:Property ;+ rdfs:label "min exclusive"@en ;+ rdfs:comment "Specifies the minimum exclusive value of each value node."@en ;+ rdfs:isDefinedBy sh: .+++sh:MinInclusiveConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Min-inclusive constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the range of value nodes with a minimum inclusive value."@en ;+ sh:parameter sh:MinInclusiveConstraintComponent-minInclusive ;+ rdfs:isDefinedBy sh: .++sh:MinInclusiveConstraintComponent-minInclusive+ a sh:Parameter ;+ sh:path sh:minInclusive ;+ sh:maxCount 1 ;+ sh:nodeKind sh:Literal ;+ rdfs:isDefinedBy sh: .++sh:minInclusive+ a rdf:Property ;+ rdfs:label "min inclusive"@en ;+ rdfs:comment "Specifies the minimum inclusive value of each value node."@en ;+ rdfs:isDefinedBy sh: .+++sh:MinLengthConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Min-length constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the minimum string length of value nodes."@en ;+ sh:parameter sh:MinLengthConstraintComponent-minLength ;+ rdfs:isDefinedBy sh: .++sh:MinLengthConstraintComponent-minLength+ a sh:Parameter ;+ sh:path sh:minLength ;+ sh:datatype xsd:integer ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:minLength+ a rdf:Property ;+ rdfs:label "min length"@en ;+ rdfs:comment "Specifies the minimum string length of each value node."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .+++sh:NodeConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Node constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that all value nodes conform to the given node shape."@en ;+ sh:parameter sh:NodeConstraintComponent-node ;+ rdfs:isDefinedBy sh: .++sh:NodeConstraintComponent-node+ a sh:Parameter ;+ sh:path sh:node ;+ rdfs:isDefinedBy sh: .++sh:node+ a rdf:Property ;+ rdfs:label "node"@en ;+ rdfs:comment "Specifies the node shape that all value nodes must conform to."@en ;+ rdfs:range sh:NodeShape ;+ rdfs:isDefinedBy sh: .+++sh:NodeKindConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Node-kind constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the RDF node kind of each value node."@en ;+ sh:parameter sh:NodeKindConstraintComponent-nodeKind ;+ rdfs:isDefinedBy sh: .++sh:NodeKindConstraintComponent-nodeKind+ a sh:Parameter ;+ sh:path sh:nodeKind ;+ sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:nodeKind+ a rdf:Property ;+ rdfs:label "node kind"@en ;+ rdfs:comment "Specifies the node kind (e.g. IRI or literal) each value node."@en ;+ rdfs:range sh:NodeKind ;+ rdfs:isDefinedBy sh: .+++sh:NotConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Not constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that value nodes do not conform to a given shape."@en ;+ sh:parameter sh:NotConstraintComponent-not ;+ rdfs:isDefinedBy sh: .++sh:NotConstraintComponent-not+ a sh:Parameter ;+ sh:path sh:not ;+ rdfs:isDefinedBy sh: .++sh:not+ a rdf:Property ;+ rdfs:label "not"@en ;+ rdfs:comment "Specifies a shape that the value nodes must not conform to."@en ;+ rdfs:range sh:Shape ;+ rdfs:isDefinedBy sh: .+++sh:OrConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Or constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the value nodes so that they conform to at least one out of several provided shapes."@en ;+ sh:parameter sh:OrConstraintComponent-or ;+ rdfs:isDefinedBy sh: .++sh:OrConstraintComponent-or+ a sh:Parameter ;+ sh:path sh:or ;+ rdfs:isDefinedBy sh: .++sh:or+ a rdf:Property ;+ rdfs:label "or"@en ;+ rdfs:comment "Specifies a list of shapes so that the value nodes must conform to at least one of the shapes."@en ;+ rdfs:range rdf:List ; # members: sh:Shape ;+ rdfs:isDefinedBy sh: .+++sh:PatternConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Pattern constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that every value node matches a given regular expression."@en ;+ sh:parameter sh:PatternConstraintComponent-pattern ;+ sh:parameter sh:PatternConstraintComponent-flags ;+ rdfs:isDefinedBy sh: .++sh:PatternConstraintComponent-pattern+ a sh:Parameter ;+ sh:path sh:pattern ;+ sh:datatype xsd:string ;+ rdfs:isDefinedBy sh: .++sh:PatternConstraintComponent-flags+ a sh:Parameter ;+ sh:path sh:flags ;+ sh:datatype xsd:string ;+ sh:optional true ;+ rdfs:isDefinedBy sh: .++sh:flags+ a rdf:Property ;+ rdfs:label "flags"@en ;+ rdfs:comment "An optional flag to be used with regular expression pattern matching."@en ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .++sh:pattern+ a rdf:Property ;+ rdfs:label "pattern"@en ;+ rdfs:comment "Specifies a regular expression pattern that the string representations of the value nodes must match."@en ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .+++sh:PropertyConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Property constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that all value nodes conform to the given property shape."@en ;+ sh:parameter sh:PropertyConstraintComponent-property ;+ rdfs:isDefinedBy sh: .++sh:PropertyConstraintComponent-property+ a sh:Parameter ;+ sh:path sh:property ;+ rdfs:isDefinedBy sh: .++sh:property+ a rdf:Property ;+ rdfs:label "property"@en ;+ rdfs:comment "Links a shape to its property shapes."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range sh:PropertyShape ;+ rdfs:isDefinedBy sh: .+++sh:QualifiedMaxCountConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Qualified-max-count constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that a specified maximum number of value nodes conforms to a given shape."@en ;+ sh:parameter sh:QualifiedMaxCountConstraintComponent-qualifiedMaxCount ;+ sh:parameter sh:QualifiedMaxCountConstraintComponent-qualifiedValueShape ;+ sh:parameter sh:QualifiedMaxCountConstraintComponent-qualifiedValueShapesDisjoint ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMaxCountConstraintComponent-qualifiedMaxCount+ a sh:Parameter ;+ sh:path sh:qualifiedMaxCount ;+ sh:datatype xsd:integer ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMaxCountConstraintComponent-qualifiedValueShape+ a sh:Parameter ;+ sh:path sh:qualifiedValueShape ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMaxCountConstraintComponent-qualifiedValueShapesDisjoint+ a sh:Parameter ;+ sh:path sh:qualifiedValueShapesDisjoint ;+ sh:datatype xsd:boolean ;+ sh:optional true ;+ rdfs:isDefinedBy sh: .+++sh:QualifiedMinCountConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Qualified-min-count constraint component"@en ;+ rdfs:comment "A constraint component that can be used to verify that a specified minimum number of value nodes conforms to a given shape."@en ;+ sh:parameter sh:QualifiedMinCountConstraintComponent-qualifiedMinCount ;+ sh:parameter sh:QualifiedMinCountConstraintComponent-qualifiedValueShape ;+ sh:parameter sh:QualifiedMinCountConstraintComponent-qualifiedValueShapesDisjoint ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMinCountConstraintComponent-qualifiedMinCount+ a sh:Parameter ;+ sh:path sh:qualifiedMinCount ;+ sh:datatype xsd:integer ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMinCountConstraintComponent-qualifiedValueShape+ a sh:Parameter ;+ sh:path sh:qualifiedValueShape ;+ rdfs:isDefinedBy sh: .++sh:QualifiedMinCountConstraintComponent-qualifiedValueShapesDisjoint+ a sh:Parameter ;+ sh:path sh:qualifiedValueShapesDisjoint ;+ sh:datatype xsd:boolean ;+ sh:optional true ;+ rdfs:isDefinedBy sh: .++sh:qualifiedMaxCount+ a rdf:Property ;+ rdfs:label "qualified max count"@en ;+ rdfs:comment "The maximum number of value nodes that can conform to the shape."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .++sh:qualifiedMinCount+ a rdf:Property ;+ rdfs:label "qualified min count"@en ;+ rdfs:comment "The minimum number of value nodes that must conform to the shape."@en ;+ rdfs:range xsd:integer ;+ rdfs:isDefinedBy sh: .++sh:qualifiedValueShape+ a rdf:Property ;+ rdfs:label "qualified value shape"@en ;+ rdfs:comment "The shape that a specified number of values must conform to."@en ;+ rdfs:range sh:Shape ;+ rdfs:isDefinedBy sh: .+ +sh:qualifiedValueShapesDisjoint+ a rdf:Property ;+ rdfs:label "qualified value shapes disjoint"@en ;+ rdfs:comment "Can be used to mark the qualified value shape to be disjoint with its sibling shapes."@en ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .+++sh:UniqueLangConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Unique-languages constraint component"@en ;+ rdfs:comment "A constraint component that can be used to specify that no pair of value nodes may use the same language tag."@en ;+ sh:parameter sh:UniqueLangConstraintComponent-uniqueLang ;+ rdfs:isDefinedBy sh: .++sh:UniqueLangConstraintComponent-uniqueLang+ a sh:Parameter ;+ sh:path sh:uniqueLang ;+ sh:datatype xsd:boolean ;+ sh:maxCount 1 ;+ rdfs:isDefinedBy sh: .++sh:uniqueLang+ a rdf:Property ;+ rdfs:label "unique languages"@en ;+ rdfs:comment "Specifies whether all node values must have a unique (or no) language tag."@en ;+ rdfs:range xsd:boolean ;+ rdfs:isDefinedBy sh: .+++sh:XoneConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Exactly one constraint component"@en ;+ rdfs:comment "A constraint component that can be used to restrict the value nodes so that they conform to exactly one out of several provided shapes."@en ;+ sh:parameter sh:XoneConstraintComponent-xone ;+ rdfs:isDefinedBy sh: .++sh:XoneConstraintComponent-xone+ a sh:Parameter ;+ sh:path sh:xone ;+ rdfs:isDefinedBy sh: .++sh:xone+ a rdf:Property ;+ rdfs:label "exactly one"@en ;+ rdfs:comment "Specifies a list of shapes so that the value nodes must conform to exactly one of the shapes."@en ;+ rdfs:range rdf:List ; # members: sh:Shape ;+ rdfs:isDefinedBy sh: .+ ++# SPARQL-based Constraints support --------------------------------------------++sh:SPARQLConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "SPARQL constraint component"@en ;+ rdfs:comment "A constraint component that can be used to define constraints based on SPARQL queries."@en ;+ sh:parameter sh:SPARQLConstraintComponent-sparql ;+ rdfs:isDefinedBy sh: .++sh:SPARQLConstraintComponent-sparql+ a sh:Parameter ;+ sh:path sh:sparql ;+ rdfs:isDefinedBy sh: .++sh:sparql+ a rdf:Property ;+ rdfs:label "constraint (in SPARQL)"@en ;+ rdfs:comment "Links a shape with SPARQL constraints."@en ;+ rdfs:domain sh:Shape ;+ rdfs:range sh:SPARQLConstraint ;+ rdfs:isDefinedBy sh: .++sh:SPARQLConstraint+ a rdfs:Class ;+ rdfs:label "SPARQL constraint"@en ;+ rdfs:comment "The class of constraints based on SPARQL SELECT queries."@en ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .+++# Derived Values support ------------------------------------------------------++sh:DerivedValuesConstraintComponent+ a sh:ConstraintComponent ;+ rdfs:label "Derived-values constraint component"@en ;+ rdfs:comment "A constraint component that can be used to state that the set of value nodes must be equivalent to a set of values derived using a given mechanism, such as a SPARQL query."@en ;+ sh:parameter [+ sh:path sh:derivedValues ;+ sh:class sh:ValuesDeriver ;+ ] ;+ rdfs:isDefinedBy sh: .++sh:derivedValues+ a rdf:Property ;+ rdfs:label "derived values"@en ;+ rdfs:comment "Links a constraint with a sh:ValuesDeriver used to compute the property values."@en ;+ rdfs:range sh:ValuesDeriver ;+ rdfs:isDefinedBy sh: .++sh:ValuesDeriver+ a rdfs:Class ;+ rdfs:label "Values deriver"@en ;+ rdfs:comment "The class of objects that can be used to derive values. SHACL itself only defines a single subclass, sh:SPARQLValuesDeriver."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:SPARQLValuesDeriver+ a rdfs:Class ;+ rdfs:label "SPARQL values deriver"@en ;+ rdfs:comment "The class of objects that can be used to derive values based on a SPARQL SELECT query."@en ;+ rdfs:subClassOf sh:ValuesDeriver ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .+++# Non-validating constraint properties ----------------------------------------++sh:defaultValue+ a rdf:Property ;+ rdfs:label "default value"@en ;+ rdfs:comment "A default value for a property, for example for user interface tools to pre-populate input fields."@en ;+ rdfs:domain sh:PropertyShape ;+ rdfs:isDefinedBy sh: .++sh:description+ a rdf:Property ;+ rdfs:label "description"@en ;+ rdfs:comment "Human-readable descriptions for the property in the context of the surrounding shape."@en ;+ rdfs:domain sh:PropertyShape ;+ # range: xsd:string or rdf:langString+ rdfs:isDefinedBy sh: .++sh:group+ a rdf:Property ;+ rdfs:label "group"@en ;+ rdfs:comment "Can be used to link to a property group to indicate that a property shape belongs to a group of related property shapes."@en ;+ rdfs:domain sh:PropertyShape ;+ rdfs:range sh:PropertyGroup ;+ rdfs:isDefinedBy sh: .++sh:name+ a rdf:Property ;+ rdfs:label "name"@en ;+ rdfs:comment "Human-readable labels for the property in the context of the surrounding shape."@en ;+ rdfs:domain sh:PropertyShape ;+ # range: xsd:string or rdf:langString+ rdfs:isDefinedBy sh: .++sh:order+ a rdf:Property ;+ rdfs:label "order"@en ;+ rdfs:comment "Specifies the relative order of this compared to its siblings. For example use 0 for the first, 1 for the second."@en ;+ # domain: sh:PropertyShape or sh:PropertyGroup+ # range: xsd:decimal or xsd:integer ;+ rdfs:isDefinedBy sh: .++sh:PropertyGroup+ a rdfs:Class ;+ rdfs:label "Property group"@en ;+ rdfs:comment "Instances of this class represent groups of property shapes that belong together."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .+++# Functions Vocabulary --------------------------------------------------------++sh:Function+ a rdfs:Class ;+ rdfs:label "Function"@en ;+ rdfs:comment "The class of SHACL functions."@en ;+ rdfs:subClassOf sh:Parameterizable ;+ rdfs:isDefinedBy sh: .++sh:returnType+ a rdf:Property ;+ rdfs:label "return type"@en ;+ rdfs:comment "The expected type of values returned by the associated function."@en ;+ rdfs:domain sh:Function ;+ rdfs:range rdfs:Class ;+ rdfs:isDefinedBy sh: .++sh:SPARQLFunction+ a rdfs:Class ;+ rdfs:label "SPARQL function"@en ;+ rdfs:comment "A function backed by a SPARQL query - either ASK or SELECT."@en ;+ rdfs:subClassOf sh:Function ;+ rdfs:subClassOf sh:SPARQLAskExecutable ;+ rdfs:subClassOf sh:SPARQLSelectExecutable ;+ rdfs:isDefinedBy sh: .+++# Result Annotations ----------------------------------------------------------++sh:resultAnnotation+ a rdf:Property ;+ rdfs:label "result annotation"@en ;+ rdfs:comment "Links a SPARQL validator with zero or more sh:ResultAnnotation instances, defining how to derive additional result properties based on the variables of the SELECT query."@en ;+ rdfs:domain sh:SPARQLSelectValidator ;+ rdfs:range sh:ResultAnnotation ;+ rdfs:isDefinedBy sh: .++sh:ResultAnnotation+ a rdfs:Class ;+ rdfs:label "Result annotation"@en ;+ rdfs:comment "A class of result annotations, which define the rules to derive the values of a given annotation property as extra values for a validation result."@en ;+ rdfs:subClassOf rdfs:Resource ;+ rdfs:isDefinedBy sh: .++sh:annotationProperty+ a rdf:Property ;+ rdfs:label "annotation property"@en ;+ rdfs:comment "The annotation property that shall be set."@en ;+ rdfs:domain sh:ResultAnnotation ;+ rdfs:range rdf:Property ;+ rdfs:isDefinedBy sh: .++sh:annotationValue+ a rdf:Property ;+ rdfs:label "annotation value"@en ;+ rdfs:comment "The (default) values of the annotation property."@en ;+ rdfs:domain sh:ResultAnnotation ;+ rdfs:isDefinedBy sh: .++sh:annotationVarName+ a rdf:Property ;+ rdfs:label "annotation variable name"@en ;+ rdfs:comment "The name of the SPARQL variable from the SELECT clause that shall be used for the values."@en ;+ rdfs:domain sh:ResultAnnotation ;+ rdfs:range xsd:string ;+ rdfs:isDefinedBy sh: .
+ resources/skos.ttl view
@@ -0,0 +1,278 @@+@prefix owl: <http://www.w3.org/2002/07/owl#> .+@prefix dc: <http://purl.org/dc/terms/> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix skos: <http://www.w3.org/2004/02/skos/core#> .+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .++<http://www.w3.org/2004/02/skos/core>+ a owl:Ontology ;+ dc:title "SKOS Vocabulary"@en ;+ dc:contributor "Dave Beckett", "Nikki Rogers", "Participants in W3C's Semantic Web Deployment Working Group." ;+ dc:description "An RDF vocabulary for describing the basic structure and content of concept schemes such as thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', other types of controlled vocabulary, and also concept schemes embedded in glossaries and terminologies."@en ;+ dc:creator "Alistair Miles", "Sean Bechhofer" ;+ rdfs:seeAlso <http://www.w3.org/TR/skos-reference/> .++skos:Concept+ rdfs:label "Concept"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "An idea or notion; a unit of thought."@en ;+ a owl:Class .++skos:ConceptScheme+ rdfs:label "Concept Scheme"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A set of concepts, optionally including statements about semantic relationships between those concepts."@en ;+ skos:scopeNote "A concept scheme may be defined to include concepts from different sources."@en ;+ skos:example "Thesauri, classification schemes, subject heading lists, taxonomies, 'folksonomies', and other types of controlled vocabulary are all examples of concept schemes. Concept schemes are also embedded in glossaries and terminologies."@en ;+ a owl:Class ;+ owl:disjointWith skos:Concept .++skos:Collection+ rdfs:label "Collection"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A meaningful collection of concepts."@en ;+ skos:scopeNote "Labelled collections can be used where you would like a set of concepts to be displayed under a 'node label' in the hierarchy."@en ;+ a owl:Class ;+ owl:disjointWith skos:Concept, skos:ConceptScheme .++skos:OrderedCollection+ rdfs:label "Ordered Collection"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "An ordered collection of concepts, where both the grouping and the ordering are meaningful."@en ;+ skos:scopeNote "Ordered collections can be used where you would like a set of concepts to be displayed in a specific order, and optionally under a 'node label'."@en ;+ a owl:Class ;+ rdfs:subClassOf skos:Collection .++skos:inScheme+ rdfs:label "is in scheme"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a resource (for example a concept) to a concept scheme in which it is included."@en ;+ skos:scopeNote "A concept may be a member of more than one concept scheme."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:range skos:ConceptScheme .++skos:hasTopConcept+ rdfs:label "has top concept"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates, by convention, a concept scheme to a concept which is topmost in the broader/narrower concept hierarchies for that scheme, providing an entry point to these hierarchies."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:domain skos:ConceptScheme ;+ rdfs:range skos:Concept ;+ owl:inverseOf skos:topConceptOf .++skos:topConceptOf+ rdfs:label "is top concept in scheme"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a concept to the concept scheme that it is a top level concept of."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:inScheme ;+ owl:inverseOf skos:hasTopConcept ;+ rdfs:domain skos:Concept ;+ rdfs:range skos:ConceptScheme .++skos:prefLabel+ rdfs:label "preferred label"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "The preferred lexical label for a resource, in a given language."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf rdfs:label ;+ rdfs:comment "A resource has no more than one value of skos:prefLabel per language tag, and no more than one value of skos:prefLabel without language tag."@en, "The range of skos:prefLabel is the class of RDF plain literals."@en, """skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise+ disjoint properties."""@en .++skos:altLabel+ rdfs:label "alternative label"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "An alternative lexical label for a resource."@en ;+ skos:example "Acronyms, abbreviations, spelling variants, and irregular plural/singular forms may be included among the alternative labels for a concept. Mis-spelled terms are normally included as hidden labels (see skos:hiddenLabel)."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf rdfs:label ;+ rdfs:comment "The range of skos:altLabel is the class of RDF plain literals."@en, "skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties."@en .++skos:hiddenLabel+ rdfs:label "hidden label"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A lexical label for a resource that should be hidden when generating visual displays of the resource, but should still be accessible to free text search operations."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf rdfs:label ;+ rdfs:comment "The range of skos:hiddenLabel is the class of RDF plain literals."@en, "skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties."@en .++skos:notation+ rdfs:label "notation"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A notation, also known as classification code, is a string of characters such as \"T58.5\" or \"303.4833\" used to uniquely identify a concept within the scope of a given concept scheme."@en ;+ skos:scopeNote "By convention, skos:notation is used with a typed literal in the object position of the triple."@en ;+ a owl:DatatypeProperty, rdf:Property .++skos:note+ rdfs:label "note"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A general note, for any purpose."@en ;+ skos:scopeNote "This property may be used directly, or as a super-property for more specific note types."@en ;+ a owl:AnnotationProperty, rdf:Property .++skos:changeNote+ rdfs:label "change note"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A note about a modification to a concept."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:definition+ rdfs:label "definition"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A statement or formal explanation of the meaning of a concept."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:editorialNote+ rdfs:label "editorial note"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A note for an editor, translator or maintainer of the vocabulary."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:example+ rdfs:label "example"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "An example of the use of a concept."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:historyNote+ rdfs:label "history note"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A note about the past state/use/meaning of a concept."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:scopeNote+ rdfs:label "scope note"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "A note that helps to clarify the meaning and/or the use of a concept."@en ;+ a owl:AnnotationProperty, rdf:Property ;+ rdfs:subPropertyOf skos:note .++skos:semanticRelation+ rdfs:label "is in semantic relation with"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Links a concept to a concept related by meaning."@en ;+ skos:scopeNote "This property should not be used directly, but as a super-property for all properties denoting a relationship of meaning between concepts."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:domain skos:Concept ;+ rdfs:range skos:Concept .++skos:broader+ rdfs:label "has broader"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a concept to a concept that is more general in meaning."@en ;+ rdfs:comment "Broader concepts are typically rendered as parents in a concept hierarchy (tree)."@en ;+ skos:scopeNote "By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:broaderTransitive ;+ owl:inverseOf skos:narrower .++skos:narrower+ rdfs:label "has narrower"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a concept to a concept that is more specific in meaning."@en ;+ skos:scopeNote "By convention, skos:broader is only used to assert an immediate (i.e. direct) hierarchical link between two conceptual resources."@en ;+ rdfs:comment "Narrower concepts are typically rendered as children in a concept hierarchy (tree)."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:narrowerTransitive ;+ owl:inverseOf skos:broader .++skos:related+ rdfs:label "has related"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a concept to a concept with which there is an associative semantic relationship."@en ;+ a owl:ObjectProperty, owl:SymmetricProperty, rdf:Property ;+ rdfs:subPropertyOf skos:semanticRelation ;+ rdfs:comment "skos:related is disjoint with skos:broaderTransitive"@en .++skos:broaderTransitive+ rdfs:label "has broader transitive"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:broaderTransitive is a transitive superproperty of skos:broader." ;+ skos:scopeNote "By convention, skos:broaderTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application."@en ;+ a owl:ObjectProperty, owl:TransitiveProperty, rdf:Property ;+ rdfs:subPropertyOf skos:semanticRelation ;+ owl:inverseOf skos:narrowerTransitive .++skos:narrowerTransitive+ rdfs:label "has narrower transitive"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:narrowerTransitive is a transitive superproperty of skos:narrower." ;+ skos:scopeNote "By convention, skos:narrowerTransitive is not used to make assertions. Rather, the properties can be used to draw inferences about the transitive closure of the hierarchical relation, which is useful e.g. when implementing a simple query expansion algorithm in a search application."@en ;+ a owl:ObjectProperty, owl:TransitiveProperty, rdf:Property ;+ rdfs:subPropertyOf skos:semanticRelation ;+ owl:inverseOf skos:broaderTransitive .++skos:member+ rdfs:label "has member"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates a collection to one of its members."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:domain skos:Collection ;+ rdfs:range [+ a owl:Class ;+ owl:unionOf (+ skos:Concept+ skos:Collection+ )+ ] .++skos:memberList+ rdfs:label "has member list"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates an ordered collection to the RDF list containing its members."@en ;+ a owl:ObjectProperty, owl:FunctionalProperty, rdf:Property ;+ rdfs:domain skos:OrderedCollection ;+ rdfs:range rdf:List ;+ rdfs:comment """For any resource, every item in the list given as the value of the+ skos:memberList property is also a value of the skos:member property."""@en .++skos:mappingRelation+ rdfs:label "is in mapping relation with"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "Relates two concepts coming, by convention, from different schemes, and that have comparable meanings"@en ;+ rdfs:comment "These concept mapping relations mirror semantic relations, and the data model defined below is similar (with the exception of skos:exactMatch) to the data model defined for semantic relations. A distinct vocabulary is provided for concept mapping relations, to provide a convenient way to differentiate links within a concept scheme from links between concept schemes. However, this pattern of usage is not a formal requirement of the SKOS data model, and relies on informal definitions of best practice."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:semanticRelation .++skos:broadMatch+ rdfs:label "has broader match"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:broadMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:mappingRelation, skos:broader ;+ owl:inverseOf skos:narrowMatch .++skos:narrowMatch+ rdfs:label "has narrower match"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:narrowMatch is used to state a hierarchical mapping link between two conceptual resources in different concept schemes."@en ;+ a owl:ObjectProperty, rdf:Property ;+ rdfs:subPropertyOf skos:mappingRelation, skos:narrower ;+ owl:inverseOf skos:broadMatch .++skos:relatedMatch+ rdfs:label "has related match"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:relatedMatch is used to state an associative mapping link between two conceptual resources in different concept schemes."@en ;+ a owl:ObjectProperty, owl:SymmetricProperty, rdf:Property ;+ rdfs:subPropertyOf skos:mappingRelation, skos:related .++skos:exactMatch+ rdfs:label "has exact match"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:exactMatch is used to link two concepts, indicating a high degree of confidence that the concepts can be used interchangeably across a wide range of information retrieval applications. skos:exactMatch is a transitive property, and is a sub-property of skos:closeMatch."@en ;+ a owl:ObjectProperty, owl:SymmetricProperty, owl:TransitiveProperty, rdf:Property ;+ rdfs:subPropertyOf skos:closeMatch ;+ rdfs:comment "skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch."@en .++skos:closeMatch+ rdfs:label "has close match"@en ;+ rdfs:isDefinedBy <http://www.w3.org/2004/02/skos/core> ;+ skos:definition "skos:closeMatch is used to link two concepts that are sufficiently similar that they can be used interchangeably in some information retrieval applications. In order to avoid the possibility of \"compound errors\" when combining mappings across more than two concept schemes, skos:closeMatch is not declared to be a transitive property."@en ;+ a owl:ObjectProperty, owl:SymmetricProperty, rdf:Property ;+ rdfs:subPropertyOf skos:mappingRelation .
+ resources/vann.ttl view
@@ -0,0 +1,82 @@+@prefix foaf: <http://xmlns.com/foaf/0.1/> .+@prefix dct: <http://purl.org/dc/terms/> .+@prefix dc: <http://purl.org/dc/elements/1.1/> .+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .+@prefix vann: <http://purl.org/vocab/vann/> .++<http://iandavis.com/id/me>+ a foaf:Person ;+ foaf:name "Ian Davis" .++<http://purl.org/vocab/vann/>+ dct:creator <http://iandavis.com/id/me> ;+ dct:date "2010-06-07" ;+ dct:description "This document describes a vocabulary for annotating descriptions of vocabularies with examples and usage notes."@en ;+ dct:identifier "http://purl.org/vocab/vann/vann-vocab-20050401" ;+ dct:isVersionOf <http://purl.org/vocab/vann/> ;+ dct:rights "Copyright © 2005 Ian Davis" ;+ dct:title "VANN: A vocabulary for annotating vocabulary descriptions"@en ;+ vann:preferredNamespacePrefix "vann" ;+ vann:preferredNamespaceUri "http://purl.org/vocab/vann/" ;+ a <http://www.w3.org/2002/07/owl#Ontology> .++vann:changes+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "A reference to a resource that describes changes between this version of a vocabulary and the previous."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Changes"@en ;+ rdfs:subPropertyOf rdfs:seeAlso .++vann:example+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "A reference to a resource that provides an example of how this resource can be used."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Example"@en ;+ rdfs:subPropertyOf rdfs:seeAlso .++vann:preferredNamespacePrefix+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "The preferred namespace prefix to use when using terms from this vocabulary in an XML document."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Preferred Namespace Prefix"@en .++vann:preferredNamespaceUri+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "The preferred namespace URI to use when using terms from this vocabulary in an XML document."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Preferred Namespace Uri"@en .++vann:termGroup+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "A group of related terms in a vocabulary."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Term Group"@en .++vann:usageNote+ a <http://www.w3.org/2002/07/owl#AnnotationProperty> ;+ rdfs:comment "A reference to a resource that provides information on how this resource is to be used."@en ;+ rdfs:isDefinedBy <http://purl.org/vocab/vann/> ;+ rdfs:label "Usage Note"@en ;+ rdfs:subPropertyOf rdfs:seeAlso .++<http://vocab.org/vann/.html>+ dc:format "text/html" ;+ a <http://purl.org/dc/dcmitype/Text>, foaf:Document ;+ rdfs:label "HTML" .++<http://vocab.org/vann/.json>+ dc:format "application/json" ;+ a <http://purl.org/dc/dcmitype/Text>, foaf:Document ;+ rdfs:label "JSON" .++<http://vocab.org/vann/.rdf>+ dct:hasFormat <http://vocab.org/vann/.html>, <http://vocab.org/vann/.json>, <http://vocab.org/vann/.turtle> ;+ a <http://purl.org/dc/dcmitype/Text>, foaf:Document ;+ foaf:primaryTopic <http://purl.org/vocab/vann/> ;+ foaf:topic <http://purl.org/vocab/vann/> .++<http://vocab.org/vann/.turtle>+ dc:format "text/plain" ;+ a <http://purl.org/dc/dcmitype/Text>, foaf:Document ;+ rdfs:label "Turtle" .+
+ resources/xsd.ttl view
@@ -0,0 +1,221 @@+@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.+@prefix owl: <http://www.w3.org/2002/07/owl#> .++++xsd: rdfs:label "XSD Namespace Document";+ <http://purl.org/vocab/vann/preferredNamespaceUri> "http://www.w3.org/2001/XMLSchema#";+ <http://purl.org/dc/elements/1.1/creator> <http://sebastian.tramp.name>;+ rdfs:comment """This file is a missing RDF description of the XML Schema datatypes used in RDF/OWL.+ Please refer to http://www.w3.org/TR/owl-ref/#rdf-datatype for a list of valid datatypes.""" .++xsd:pattern a owl:DatatypeProperty;+ rdfs:label "patterns" .++xsd:string a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#string>;+ rdfs:comment "The string datatype represents character strings in XML. The ·value space· of string is the set of finite-length sequences of characters (as defined in [XML 1.0 (Second Edition)]) that ·match· the Char production from [XML 1.0 (Second Edition)]. A character is an atomic unit of communication; it is not further specified except to note that every character has a corresponding Universal Character Set code point, which is an integer.";+ rdfs:label "string" .++xsd:normalizedString a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#normalizedString>;+ rdfs:comment "normalizedString represents white space normalized strings. The ·value space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·lexical space· of normalizedString is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters. The ·base type· of normalizedString is string.";+ rdfs:label "normalizedString" .++xsd:token a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#token>;+ rdfs:comment "token represents tokenized strings. The ·value space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·lexical space· of token is the set of strings that do not contain the carriage return (#xD), line feed (#xA) nor tab (#x9) characters, that have no leading or trailing spaces (#x20) and that have no internal sequences of two or more spaces. The ·base type· of token is normalizedString.";+ rdfs:label "token" .++xsd:language a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#language>;+ rdfs:comment "language represents natural language identifiers as defined by by [RFC 3066] . The ·value space· of language is the set of all strings that are valid language identifiers as defined [RFC 3066] . The ·lexical space· of language is the set of all strings that conform to the pattern [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})* . The ·base type· of language is token.";+ rdfs:label "language" .++xsd:NMTOKEN a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#NMTOKEN>;+ rdfs:comment "NMTOKEN represents the NMTOKEN attribute type from [XML 1.0 (Second Edition)]. The ·value space· of NMTOKEN is the set of tokens that ·match· the Nmtoken production in [XML 1.0 (Second Edition)]. The ·lexical space· of NMTOKEN is the set of strings that ·match· the Nmtoken production in [XML 1.0 (Second Edition)]. The ·base type· of NMTOKEN is token.";+ rdfs:label "NMTOKEN" .++xsd:Name a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#Name>;+ rdfs:comment "Name represents XML Names. The ·value space· of Name is the set of all strings which ·match· the Name production of [XML 1.0 (Second Edition)]. The ·lexical space· of Name is the set of all strings which ·match· the Name production of [XML 1.0 (Second Edition)]. The ·base type· of Name is token.";+ rdfs:label "Name" .++xsd:NCName a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#NCName>;+ rdfs:comment "NCName represents XML 'non-colonized' Names. The ·value space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·lexical space· of NCName is the set of all strings which ·match· the NCName production of [Namespaces in XML]. The ·base type· of NCName is Name.";+ rdfs:label "NCName" .+++xsd:boolean a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#boolean>;+ rdfs:comment "An instance of a datatype that is defined as ·boolean· can have the following legal literals {true, false, 1, 0}.";+ rdfs:label "boolean" .++xsd:decimal a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#decimal>;+ rdfs:comment "decimal has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39) separated by a period as a decimal indicator. An optional leading sign is allowed. If the sign is omitted, '+' is assumed. Leading and trailing zeroes are optional. If the fractional part is zero, the period and following zeroes can be omitted. For example: -1.23, 12678967.543233, +100000.00, 210.";+ rdfs:label "decimal" .++xsd:float a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#float>;+ rdfs:comment "float values have a lexical representation consisting of a mantissa followed, optionally, by the character 'E' or 'e', followed by an exponent. The exponent ·must· be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the lexical rules for integer and decimal. If the 'E' or 'e' and the following exponent are omitted, an exponent value of 0 is assumed. The special values positive and negative infinity and not-a-number have lexical representations INF, -INF and NaN, respectively. Lexical representations for zero may take a positive or negative sign. For example, -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF are all legal literals for float.";+ rdfs:label "float" .++xsd:double a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#double>;+ rdfs:comment "double values have a lexical representation consisting of a mantissa followed, optionally, by the character 'E' or 'e', followed by an exponent. The exponent ·must· be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the lexical rules for integer and decimal. If the 'E' or 'e' and the following exponent are omitted, an exponent value of 0 is assumed. The special values positive and negative infinity and not-a-number have lexical representations INF, -INF and NaN, respectively. Lexical representations for zero may take a positive or negative sign. For example, -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF are all legal literals for double.";+ rdfs:label "double" .++xsd:integer a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#integer>;+ rdfs:comment "integer has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39) with an optional leading sign. If the sign is omitted, '+' is assumed. For example: -1, 0, 12678967543233, +100000.";+ rdfs:label "integer" .++xsd:positiveInteger a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#positiveInteger>;+ rdfs:comment "positiveInteger has a lexical representation consisting of an optional positive sign ('+') followed by a finite-length sequence of decimal digits (#x30-#x39). For example: 1, 12678967543233, +100000.";+ rdfs:label "positiveInteger" .++xsd:nonPositiveInteger a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger>;+ rdfs:comment "nonPositiveInteger has a lexical representation consisting of an optional preceding sign followed by a finite-length sequence of decimal digits (#x30-#x39). The sign may be '+' or may be omitted only for lexical forms denoting zero; in all other lexical forms, the negative sign ('-') must be present. For example: -1, 0, -12678967543233, -100000.";+ rdfs:label "nonPositiveInteger" .++xsd:negativeInteger a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#negativeInteger>;+ rdfs:comment "negativeInteger has a lexical representation consisting of a negative sign ('-') followed by a finite-length sequence of decimal digits (#x30-#x39). For example: -1, -12678967543233, -100000.";+ rdfs:label "negativeInteger" .++xsd:nonNegativeInteger a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger>;+ rdfs:comment "nonNegativeInteger has a lexical representation consisting of an optional sign followed by a finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, the positive sign ('+') is assumed. If the sign is present, it must be '+' except for lexical forms denoting zero, which may be preceded by a positive ('+') or a negative ('-') sign. For example: 1, 0, 12678967543233, +100000.";+ rdfs:label "nonNegativeInteger" .++xsd:long a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#long>;+ rdfs:comment "long is ·derived· from integer by setting the value of ·maxInclusive· to be 9223372036854775807 and ·minInclusive· to be -9223372036854775808. long has a lexical representation consisting of an optional sign followed by a finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, '+' is assumed. For example: -1, 0, 12678967543233, +100000.";+ rdfs:label "long" .++xsd:int a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#int>;+ rdfs:comment "int is ·derived· from long by setting the value of ·maxInclusive· to be 2147483647 and ·minInclusive· to be -2147483648. int has a lexical representation consisting of an optional sign followed by a finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, '+' is assumed. For example: -1, 0, 126789675, +100000.";+ rdfs:label "int" .++xsd:short a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#short>;+ rdfs:comment "short is ·derived· from int by setting the value of ·maxInclusive· to be 32767 and ·minInclusive· to be -32768. short has a lexical representation consisting of an optional sign followed by a finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, '+' is assumed. For example: -1, 0, 12678, +10000.";+ rdfs:label "short" .++xsd:byte a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#byte>;+ rdfs:comment "byte is ·derived· from short by setting the value of ·maxInclusive· to be 127 and ·minInclusive· to be -128. byte has a lexical representation consisting of an optional sign followed by a finite-length sequence of decimal digits (#x30-#x39). If the sign is omitted, '+' is assumed. For example: -1, 0, 126, +100.";+ rdfs:label "byte" .++xsd:unsignedLong a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#unsignedLong>;+ rdfs:comment "unsignedLong is ·derived· from nonNegativeInteger by setting the value of ·maxInclusive· to be 18446744073709551615. unsignedLong has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39). For example: 0, 12678967543233, 100000.";+ rdfs:label "unsignedLong" .++xsd:unsignedInt a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#unsignedInt>;+ rdfs:comment "unsignedInt is ·derived· from unsignedLong by setting the value of ·maxInclusive· to be 4294967295. unsignedInt has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39). For example: 0, 1267896754, 100000.";+ rdfs:label "unsignedInt" .++xsd:unsignedShort a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#unsignedShort>;+ rdfs:comment "unsignedShort is ·derived· from unsignedInt by setting the value of ·maxInclusive· to be 65535. unsignedShort has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39). For example: 0, 12678, 10000.";+ rdfs:label "unsignedShort" .++xsd:unsignedByte a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#unsignedByte>;+ rdfs:comment "unsignedByte is ·derived· from unsignedShort by setting the value of ·maxInclusive· to be 255. unsignedByte has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39). For example: 0, 126, 100.";+ rdfs:label "unsignedByte" .+++xsd:dateTime a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#dateTime>;+ rdfs:comment "The ·lexical space· of dateTime consists of finite-length sequences of characters of the form: '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)? For example, 2002-10-10T12:00:00-05:00 (noon on 10 October 2002, Central Daylight Savings Time as well as Eastern Standard Time in the U.S.) is 2002-10-10T17:00:00Z, five hours later than 2002-10-10T12:00:00Z.";+ rdfs:label "dateTime" .++xsd:dateTimeStamp a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema11-2/#dateTimeStamp> ;+ rdfs:comment """The lexical space of dateTimeStamp consists of strings which are in the ·lexical space· of dateTime and which also match the regular expression '.*(Z|(\\+|-)[0-9][0-9]:[0-9][0-9])'""" ;+ rdfs:label "dataTimeStamp" .++xsd:time a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#time>;+ rdfs:comment "The lexical representation for time is the left truncated lexical representation for dateTime: hh:mm:ss.sss with optional following time zone indicator. For example, to indicate 1:20 pm for Eastern Standard Time which is 5 hours behind Coordinated Universal Time (UTC), one would write: 13:20:00-05:00. See also ISO 8601 Date and Time Formats (·D).";+ rdfs:label "time" .++xsd:date a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#date>;+ rdfs:comment "The ·lexical space· of date consists of finite-length sequences of characters of the form: '-'? yyyy '-' mm '-' dd zzzzzz? where the date and optional timezone are represented exactly the same way as they are for dateTime. The first moment of the interval is that represented by: '-' yyyy '-' mm '-' dd 'T00:00:00' zzzzzz? and the least upper bound of the interval is the timeline point represented (noncanonically) by: '-' yyyy '-' mm '-' dd 'T24:00:00' zzzzzz?.";+ rdfs:label "date" .++xsd:gYearMonth a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#gYearMonth>;+ rdfs:comment "The lexical representation for gYearMonth is the reduced (right truncated) lexical representation for dateTime: CCYY-MM. No left truncation is allowed. An optional following time zone qualifier is allowed. To accommodate year values outside the range from 0001 to 9999, additional digits can be added to the left of this representation and a preceding '-' sign is allowed. For example, to indicate the month of May 1999, one would write: 1999-05. See also ISO 8601 Date and Time Formats (·D).";+ rdfs:label "gYearMonth" .++xsd:gYear a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#gYear>;+ rdfs:comment "The lexical representation for gYear is the reduced (right truncated) lexical representation for dateTime: CCYY. No left truncation is allowed. An optional following time zone qualifier is allowed as for dateTime. To accommodate year values outside the range from 0001 to 9999, additional digits can be added to the left of this representation and a preceding '-' sign is allowed. For example, to indicate 1999, one would write: 1999. See also ISO 8601 Date and Time Formats (·D).";+ rdfs:label "gYear" .++xsd:gMonthDay a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#gMonthDay>;+ rdfs:comment "The lexical representation for gMonthDay is the left truncated lexical representation for date: --MM-DD. An optional following time zone qualifier is allowed as for date. No preceding sign is allowed. No other formats are allowed. See also ISO 8601 Date and Time Formats (·D). This datatype can be used to represent a specific day in a month. To say, for example, that my birthday occurs on the 14th of September ever year.";+ rdfs:label "gMonthDay" .++xsd:gDay a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#gDay>;+ rdfs:comment "The lexical representation for gDay is the left truncated lexical representation for date: ---DD . An optional following time zone qualifier is allowed as for date. No preceding sign is allowed. No other formats are allowed. See also ISO 8601 Date and Time Formats (·D).";+ rdfs:label "gDay" .++xsd:gMonth a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#gMonth>;+ rdfs:comment "The lexical representation for gMonth is the left and right truncated lexical representation for date: --MM. An optional following time zone qualifier is allowed as for date. No preceding sign is allowed. No other formats are allowed. See also ISO 8601 Date and Time Formats (·D).";+ rdfs:label "gMonth" .++xsd:duration a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#duration>;+ rdfs:comment "The lexical representation for duration is the [ISO 8601] extended format PnYn MnDTnH nMnS, where nY represents the number of years, nM the number of months, nD the number of days, 'T' is the date/time separator, nH the number of hours, nM the number of minutes and nS the number of seconds. The number of seconds can include decimal digits to arbitrary precision.";+ rdfs:label "duration" .++xsd:hexBinary a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#hexBinary>;+ rdfs:comment "hexBinary has a lexical representation where each binary octet is encoded as a character tuple, consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. For example, '0FB7' is a hex encoding for the 16-bit integer 4023 (whose binary representation is 111110110111).";+ rdfs:label "hexBinary" .++xsd:base64Binary a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#base64Binary>;+ rdfs:comment "The lexical forms of base64Binary values are limited to the 65 characters of the Base64 Alphabet defined in [RFC 2045], i.e., a-z, A-Z, 0-9, the plus sign (+), the forward slash (/) and the equal sign (=), together with the characters defined in [XML 1.0 (Second Edition)] as white space. No other characters are allowed.";+ rdfs:label "base64Binary" .++xsd:anyURI a rdfs:Datatype;+ rdfs:isDefinedBy <http://www.w3.org/TR/xmlschema-2/#anyURI>;+ rdfs:comment "The ·lexical space· of anyURI is finite-length character sequences which, when the algorithm defined in Section 5.4 of [XML Linking Language] is applied to them, result in strings which are legal URIs according to [RFC 2396], as amended by [RFC 2732]. Note: Spaces are, in principle, allowed in the ·lexical space· of anyURI, however, their use is highly discouraged (unless they are encoded by %20).";+ rdfs:label "anyURI" .++xsd:maxInclusive a owl:DatatypeProperty;+ rdfs:isDefinedBy <https://www.w3.org/TR/xmlschema-2/#rf-maxInclusive>;+ rdfs:comment "maxInclusive is the ·inclusive upper bound· of the ·value space· for a datatype with the ·ordered· property. The value of maxInclusive ·must· be in the ·value space· of the ·base type·.";+ rdfs:label "maxInclusive" .++xsd:maxExclusive a owl:DatatypeProperty;+ rdfs:isDefinedBy <https://www.w3.org/TR/xmlschema-2/#rf-maxExclusive>;+ rdfs:comment "maxExclusive is the ·exclusive upper bound· of the ·value space· for a datatype with the ·ordered· property. The value of maxExclusive ·must· be in the ·value space· of the ·base type· or be equal to {value} in {base type definition}.";+ rdfs:label "maxExclusive".++xsd:minInclusive a owl:DatatypeProperty;+ rdfs:isDefinedBy <https://www.w3.org/TR/xmlschema-2/#rf-minInclusive>;+ rdfs:comment "minInclusive is the ·inclusive lower bound· of the ·value space· for a datatype with the ·ordered· property. The value of minInclusive ·must· be in the ·value space· of the ·base type·.";+ rdfs:label "minInclusive" .++xsd:minExclusive a owl:DatatypeProperty;+ rdfs:isDefinedBy <https://www.w3.org/TR/xmlschema-2/#rf-minExclusive>;+ rdfs:comment "minExclusive is the ·exclusive lower bound· of the ·value space· for a datatype with the ·ordered· property. The value of minExclusive ·must· be in the ·value space· of the ·base type· or be equal to {value} in {base type definition}.";+ rdfs:label "minExclusive" .
+ src/Data/RDF/BlankNode.hs view
@@ -0,0 +1,89 @@+module Data.RDF.BlankNode+ ( mkBNode,+ )+where++import Control.Applicative+import Control.Monad+import Data.Attoparsec.Text (Parser, (<?>))+import qualified Data.Attoparsec.Text as P+import Data.Char (isAsciiLower, isAsciiUpper, isDigit)+import Data.Text (Text)+import Text.Parser.Char+import Text.Parser.Combinators (option, try, unexpected)++-- Note: the NTriples parser combinators and Turtle parser combinators+-- should be shared, there's some duplication. This module could be+-- the place for those functions to be moved to, to reduce the size of+-- the NTriplesParser and TurtleParser modules.++-- mkBNode :: Text -> Either String String+-- mkBNode t = IRI . serializeIRI <$> parseIRI t++mkBNode :: Text -> Maybe String+mkBNode t =+ case parseBNodeLabel t of+ Left _e -> Nothing+ Right bString -> Just bString++parseBNodeLabel :: Text -> Either String String+parseBNodeLabel = P.parseOnly $ t_blank_node_label <* (P.endOfInput <?> "Unexpected characters at the end")++-- taken from TurtleParser (TurtleParser and NTriplesParser could+--possibly share this blank node label parser combinator?)+--+-- TODO replicate the recursion technique from [168s] for ((..)* something)?+-- [141s] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)?+-- t_blank_node_label :: (CharParsing m, Monad m) => m String+t_blank_node_label :: Parser String+t_blank_node_label = do+ void (string "_:")+ firstChar <- t_pn_chars_u <|> satisfy isDigit+ try $ (firstChar :) <$> otherChars+ where+ otherChars = option "" $ do+ xs <- many (t_pn_chars <|> char '.')+ if null xs+ then pure xs+ else+ if last xs == '.'+ then unexpected "'.' at the end of a blank node label"+ else pure xs++-- [163s] PN_CHARS_BASE+t_pn_chars_base :: CharParsing m => m Char+t_pn_chars_base = nt_pn_chars_base++-- [164s] PN_CHARS_U ::= PN_CHARS_BASE | '_'+t_pn_chars_u :: CharParsing m => m Char+t_pn_chars_u = t_pn_chars_base <|> char '_'++-- [166s] PN_CHARS ::= PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]+t_pn_chars :: CharParsing m => m Char+t_pn_chars = t_pn_chars_u <|> char '-' <|> char '\x00B7' <|> satisfy f+ where+ f = flip in_range [('0', '9'), ('\x0300', '\x036F'), ('\x203F', '\x2040')]++-- [157s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]+nt_pn_chars_base :: CharParsing m => m Char+nt_pn_chars_base = try $ satisfy isBaseChar+ where+ isBaseChar c =+ (isAsciiUpper c)+ || (isAsciiLower c)+ || (c >= '\x00C0' && c <= '\x00D6')+ || (c >= '\x00D8' && c <= '\x00F6')+ || (c >= '\x00F8' && c <= '\x02FF')+ || (c >= '\x0370' && c <= '\x037D')+ || (c >= '\x037F' && c <= '\x1FFF')+ || (c >= '\x200C' && c <= '\x200D')+ || (c >= '\x2070' && c <= '\x218F')+ || (c >= '\x2C00' && c <= '\x2FEF')+ || (c >= '\x3001' && c <= '\xD7FF')+ || (c >= '\xF900' && c <= '\xFDCF')+ || (c >= '\xFDF0' && c <= '\xFFFD')+ || (c >= '\x10000' && c <= '\xEFFFF')++{-# INLINE in_range #-}+in_range :: Char -> [(Char, Char)] -> Bool+in_range c = any (\(c1, c2) -> c >= c1 && c <= c2)
src/Data/RDF/IRI.hs view
@@ -1,23 +1,33 @@-{-# LANGUAGE CPP #-}-{-# LANGUAGE GADTs #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TupleSections #-} --- |An implementation of the RFC3987--- [RFC3987]: http://www.ietf.org/rfc/rfc3987.txt-+-- | An implementation of the RFC3987+-- [RFC3987]: http://www.ietf.org/rfc/rfc3987.txt module Data.RDF.IRI- ( IRI(..), IRIRef(..)- , Scheme(..), Authority(..), UserInfo(..), Host(..), Port(..)- , Path(..), Query(..), Fragment(..)- , IRIError(..), SchemaError(..)- , mkIRI- , serializeIRI- , parseIRI, parseRelIRI- , validateIRI, resolveIRI- , removeIRIFragment- ) where+ ( IRI (..),+ IRIRef (..),+ Scheme (..),+ Authority (..),+ UserInfo (..),+ Host (..),+ Port (..),+ Path (..),+ IRIQuery (..),+ Fragment (..),+ IRIError (..),+ SchemaError (..),+ mkIRI,+ serializeIRI,+ parseIRI,+ parseRelIRI,+ validateIRI,+ resolveIRI,+ removeIRIFragment,+ )+where #if MIN_VERSION_base(4,9,0) #if !MIN_VERSION_base(4,11,0)@@ -33,37 +43,39 @@ import Data.Maybe (maybe, isJust) #endif -import Data.Functor-import Data.List (intersperse) import Control.Applicative-import Control.Monad (guard) import Control.Arrow (first, (&&&), (>>>))-import Data.Char (isAlpha, isDigit, isAlphaNum, toUpper, toLower)-import Data.Text (Text)-import qualified Data.Text as T-import Data.Attoparsec.Text (Parser, (<?>))+import Control.Monad (guard)+import Data.Attoparsec.Text (Parser, (<?>)) import qualified Data.Attoparsec.Text as P+import Data.Char (isAlpha, isAlphaNum, isDigit, toLower, toUpper)+import Data.Functor+import Data.List (intersperse)+import Data.Text (Text)+import qualified Data.Text as T -- | A serialized IRI representation.-newtype IRI = IRI { getIRI :: Text }+newtype IRI = IRI {getIRI :: Text} deriving (Show, Eq) -- | A detailed IRI representation with its components.-data IRIRef = IRIRef- !(Maybe Scheme)- !(Maybe Authority)- !Path- !(Maybe Query)- !(Maybe Fragment)+data IRIRef+ = IRIRef+ !(Maybe Scheme)+ !(Maybe Authority)+ !Path+ !(Maybe IRIQuery)+ !(Maybe Fragment) deriving (Show, Eq, Ord) newtype Scheme = Scheme Text deriving (Show, Eq, Ord) -data Authority = Authority- !(Maybe UserInfo)- !Host- !(Maybe Port)+data Authority+ = Authority+ !(Maybe UserInfo)+ !Host+ !(Maybe Port) deriving (Show, Eq, Ord) newtype UserInfo = UserInfo Text@@ -78,11 +90,12 @@ newtype Path = Path Text deriving (Show, Eq, Semigroup, Monoid, Ord) -newtype Query = Query Text+newtype IRIQuery = IRIQuery Text deriving (Show, Eq, Semigroup, Ord) -instance Monoid Query where- mempty = Query mempty+instance Monoid IRIQuery where+ mempty = IRIQuery mempty+ #if !(MIN_VERSION_base(4,11,0)) mappend = (<>) #endif@@ -92,6 +105,7 @@ instance Monoid Fragment where mempty = Fragment mempty+ #if !(MIN_VERSION_base(4,11,0)) mappend = (<>) #endif@@ -100,9 +114,12 @@ deriving (Show, Eq) data SchemaError- = NonAlphaLeading -- ^ Scheme must start with an alphabet character- | InvalidChars -- ^ Subsequent characters in the schema were invalid- | MissingColon -- ^ Schemas must be followed by a colon+ = -- | Scheme must start with an alphabet character+ NonAlphaLeading+ | -- | Subsequent characters in the schema were invalid+ InvalidChars+ | -- | Schemas must be followed by a colon+ MissingColon deriving (Show, Eq) removeIRIFragment :: IRIRef -> IRIRef@@ -110,23 +127,27 @@ -- [TODO] use Builder serializeIRI :: IRIRef -> Text-serializeIRI (IRIRef s a p q f) = mconcat- [ maybe mempty scheme s- , maybe mempty authority a- , path p- , maybe mempty query q- , maybe mempty fragment f ]+serializeIRI (IRIRef s a p q f) =+ mconcat+ [ maybe mempty scheme s,+ maybe mempty authority a,+ path p,+ maybe mempty query q,+ maybe mempty fragment f+ ] where scheme (Scheme s') = s' <> ":"- authority (Authority u (Host h) p') = mconcat- [ "//"- , maybe mempty userInfo u- , h- , maybe mempty port p' ]+ authority (Authority u (Host h) p') =+ mconcat+ [ "//",+ maybe mempty userInfo u,+ h,+ maybe mempty port p'+ ] userInfo (UserInfo u) = u <> "@" port (Port p') = (":" <>) . T.pack . show $ p' path (Path p') = p'- query (Query q') = "?" <> q'+ query (IRIQuery q') = "?" <> q' fragment (Fragment f') = "#" <> f' mkIRI :: Text -> Either String IRI@@ -144,10 +165,12 @@ -- | IRI parsing and resolution according to algorithm 5.2 from RFC3986 -- See: http://www.ietf.org/rfc/rfc3986.txt -- [FIXME] Currently, this is a correct but naive implementation.-resolveIRI- :: Text -- ^ Base URI- -> Text -- ^ URI to resolve- -> Either String Text+resolveIRI ::+ -- | Base URI+ Text ->+ -- | URI to resolve+ Text ->+ Either String Text resolveIRI baseIri iri = serializeIRI <$> resolvedIRI where resolvedIRI = either (const resolvedRelativeIRI) resolveAbsoluteIRI (parseIRI iri)@@ -158,29 +181,31 @@ -- Parse base IRI (IRIRef bs ba bp bq _) <- parseIRI baseIri let rIriWithoutAuth = resolveIriWithoutAuth rp rq rf bs ba bp bq- rIriWithAuth = return (IRIRef bs ra (removeDotSegments rp') rq rf)+ rIriWithAuth = return (IRIRef bs ra (removeDotSegments rp') rq rf) maybe rIriWithoutAuth (const rIriWithAuth) ra- resolveIriWithoutAuth rp rq rf bs ba bp bq = return $!- if (rp == mempty)- then maybe (IRIRef bs ba bp bq rf) (const (IRIRef bs ba bp rq rf)) rq- else let (Path rp') = rp in if (T.head rp' == '/')- then IRIRef bs ba (removeDotSegments rp') rq rf- else IRIRef bs ba (removeDotSegments (merge ba bp rp)) rq rf+ resolveIriWithoutAuth rp rq rf bs ba bp bq =+ return+ $! if (rp == mempty)+ then maybe (IRIRef bs ba bp bq rf) (const (IRIRef bs ba bp rq rf)) rq+ else+ let (Path rp') = rp+ in if (T.head rp' == '/')+ then IRIRef bs ba (removeDotSegments rp') rq rf+ else IRIRef bs ba (removeDotSegments (merge ba bp rp)) rq rf removeDotSegments p = removeDotSegments' (T.split (== '/') p) mempty removeDotSegments' [] os = Path $ mconcat (intersperse "/" os) removeDotSegments' ["."] os = removeDotSegments' mempty (os <> [mempty]) removeDotSegments' [".."] [] = removeDotSegments' mempty mempty removeDotSegments' [".."] os = removeDotSegments' mempty (init os <> [mempty]) removeDotSegments' ss@[_] os = removeDotSegments' mempty (os <> ss)- removeDotSegments' (".":ss) os = removeDotSegments' ss os- removeDotSegments' ("..":ss) [] = removeDotSegments' ss mempty- removeDotSegments' ("..":ss) os@[""] = removeDotSegments' ss os- removeDotSegments' ("..":ss) os = removeDotSegments' ss (init os)- removeDotSegments' (s:ss) os = removeDotSegments' ss (os <> [s])+ removeDotSegments' ("." : ss) os = removeDotSegments' ss os+ removeDotSegments' (".." : ss) [] = removeDotSegments' ss mempty+ removeDotSegments' (".." : ss) os@[""] = removeDotSegments' ss os+ removeDotSegments' (".." : ss) os = removeDotSegments' ss (init os)+ removeDotSegments' (s : ss) os = removeDotSegments' ss (os <> [s]) merge ba (Path bp) (Path rp) | isJust ba && bp == mempty = "/" <> rp- | otherwise = T.dropWhileEnd (/= '/') bp <> rp-+ | otherwise = T.dropWhileEnd (/= '/') bp <> rp -- IRI = scheme ":" ihier-part [ "?" iquery ] [ "#" ifragment ] iriParser :: Parser IRIRef@@ -198,10 +223,10 @@ -- / ipath-empty ihierPartParser :: Parser (Maybe Authority, Path) ihierPartParser =- iauthWithPathParser <|>- ipathAbsoluteParser <|>- ipathRootlessParser <|>- ipathEmptyParser+ iauthWithPathParser+ <|> ipathAbsoluteParser+ <|> ipathRootlessParser+ <|> ipathEmptyParser -- IRI-reference = IRI / irelative-ref -- [TODO]@@ -223,28 +248,30 @@ -- / ipath-empty irelativePartParser :: Parser (Maybe Authority, Path) irelativePartParser =- iauthWithPathParser <|>- ipathAbsoluteParser <|>- ipathNoSchemeParser <|>- ipathEmptyParser+ iauthWithPathParser+ <|> ipathAbsoluteParser+ <|> ipathNoSchemeParser+ <|> ipathEmptyParser -- iauthority = [ iuserinfo "@" ] ihost [ ":" port ] iauthorityParser :: Parser Authority iauthorityParser = Authority <$> optional (iuserInfoParser <* P.string "@")- <*> ihostParser- <*> optional (P.string ":" *> portParser)- <?> "Authority"+ <*> ihostParser+ <*> optional (P.string ":" *> portParser)+ <?> "Authority" -- iuserinfo = *( iunreserved / pct-encoded / sub-delims / ":" ) iuserInfoParser :: Parser UserInfo iuserInfoParser = UserInfo . mconcat <$> P.many1 iuserInfoP- where iuserInfoP = iunreservedP <|> pctEncodedParser <|> subDelimsP <|> P.string ":"+ where+ iuserInfoP = iunreservedP <|> pctEncodedParser <|> subDelimsP <|> P.string ":" -- ihost = IP-literal / IPv4address / ireg-name ihostParser :: Parser Host-ihostParser = Host <$> (ipLiteralParser <|> ipV4AddressParser <|> iregNameParser)- <?> "Host"+ihostParser =+ Host <$> (ipLiteralParser <|> ipV4AddressParser <|> iregNameParser)+ <?> "Host" -- ireg-name = *( iunreserved / pct-encoded / sub-delims ) iregNameParser :: Parser Text@@ -306,20 +333,21 @@ -- ; non-zero-length segment without any colon ":" isegmentNzNcParser :: Parser Text isegmentNzNcParser = mconcat <$> (P.many1 _isegmentNzNcParser)- where _isegmentNzNcParser = iunreservedP <|> pctEncodedParser <|> subDelimsP <|> P.string "@"+ where+ _isegmentNzNcParser = iunreservedP <|> pctEncodedParser <|> subDelimsP <|> P.string "@" -- ipchar = iunreserved / pct-encoded / sub-delims / ":" / "@" ipcharParser :: Parser Text ipcharParser = iunreservedP <|> pctEncodedParser <|> subDelimsP <|> P.string ":" <|> P.string "@" -- iquery = *( ipchar / iprivate / "/" / "?" )-iqueryParser :: Parser Query-iqueryParser = Query <$> iqueryParser'+iqueryParser :: Parser IRIQuery+iqueryParser = IRIQuery <$> iqueryParser' iqueryParser' :: Parser Text iqueryParser' = P.char '?' *> (mconcat <$> P.many' (ipcharParser <|> iprivateParser <|> P.string "/" <|> P.string "?"))- <?> "Query"+ <?> "Query" -- ifragment = *( ipchar / "/" / "?" ) ifragmentParser :: Parser Fragment@@ -328,7 +356,7 @@ ifragmentParser' :: Parser Text ifragmentParser' = P.char '#' *> (mconcat <$> P.many' (ipcharParser <|> P.string "/" <|> P.string "?"))- <?> "Fragment"+ <?> "Fragment" -- iunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar iunreservedP :: Parser Text@@ -344,32 +372,34 @@ -- / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD -- / %xD0000-DFFFD / %xE1000-EFFFD isUcsChar :: Char -> Bool-isUcsChar c = ('\x000A0' <= c && c <= '\x0D7FF')- || ('\x0F900' <= c && c <= '\x0FDCF')- || ('\x0FDF0' <= c && c <= '\x0FFEF')- || ('\x10000' <= c && c <= '\x1FFFD')- || ('\x20000' <= c && c <= '\x2FFFD')- || ('\x30000' <= c && c <= '\x3FFFD')- || ('\x40000' <= c && c <= '\x4FFFD')- || ('\x50000' <= c && c <= '\x5FFFD')- || ('\x60000' <= c && c <= '\x6FFFD')- || ('\x70000' <= c && c <= '\x7FFFD')- || ('\x80000' <= c && c <= '\x8FFFD')- || ('\x90000' <= c && c <= '\x9FFFD')- || ('\xA0000' <= c && c <= '\xAFFFD')- || ('\xB0000' <= c && c <= '\xBFFFD')- || ('\xC0000' <= c && c <= '\xCFFFD')- || ('\xD0000' <= c && c <= '\xDFFFD')- || ('\xE1000' <= c && c <= '\xEFFFD')+isUcsChar c =+ ('\x000A0' <= c && c <= '\x0D7FF')+ || ('\x0F900' <= c && c <= '\x0FDCF')+ || ('\x0FDF0' <= c && c <= '\x0FFEF')+ || ('\x10000' <= c && c <= '\x1FFFD')+ || ('\x20000' <= c && c <= '\x2FFFD')+ || ('\x30000' <= c && c <= '\x3FFFD')+ || ('\x40000' <= c && c <= '\x4FFFD')+ || ('\x50000' <= c && c <= '\x5FFFD')+ || ('\x60000' <= c && c <= '\x6FFFD')+ || ('\x70000' <= c && c <= '\x7FFFD')+ || ('\x80000' <= c && c <= '\x8FFFD')+ || ('\x90000' <= c && c <= '\x9FFFD')+ || ('\xA0000' <= c && c <= '\xAFFFD')+ || ('\xB0000' <= c && c <= '\xBFFFD')+ || ('\xC0000' <= c && c <= '\xCFFFD')+ || ('\xD0000' <= c && c <= '\xDFFFD')+ || ('\xE1000' <= c && c <= '\xEFFFD') -- iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD iprivateParser :: Parser Text iprivateParser = T.singleton <$> P.satisfy isIPrivate isIPrivate :: Char -> Bool-isIPrivate c = ('\x00E000' <= c && c <= '\x00F8FF')- || ('\x0F0000' <= c && c <= '\x0FFFFD')- || ('\x100000' <= c && c <= '\x10FFFD')+isIPrivate c =+ ('\x00E000' <= c && c <= '\x00F8FF')+ || ('\x0F0000' <= c && c <= '\x0FFFFD')+ || ('\x100000' <= c && c <= '\x10FFFD') -- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) schemeParser :: Parser Scheme@@ -379,8 +409,12 @@ where schemeHead = P.satisfy isAlpha <?> "Scheme head" schemeRest = P.takeWhile isSchemeTailChar <?> "Scheme tail"- isSchemeTailChar c = isAlphaNum c- || c == '+' || c == '.' || c == '_' || c == '-'+ isSchemeTailChar c =+ isAlphaNum c+ || c == '+'+ || c == '.'+ || c == '_'+ || c == '-' -- port = *DIGIT portParser :: Parser Port@@ -396,12 +430,15 @@ -- IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) ipFutureParser :: Parser Text ipFutureParser =- mconcat <$> sequence [- P.string "v",- P.takeWhile1 isHexaDigit,- P.string ".",- P.takeWhile1 isValidFinalChar]- where isValidFinalChar c = isUnreserved c || isSubDelims c || c == ':'+ mconcat+ <$> sequence+ [ P.string "v",+ P.takeWhile1 isHexaDigit,+ P.string ".",+ P.takeWhile1 isValidFinalChar+ ]+ where+ isValidFinalChar c = isUnreserved c || isSubDelims c || c == ':' -- IPv6address = 6( h16 ":" ) ls32 -- / "::" 5( h16 ":" ) ls32@@ -413,19 +450,20 @@ -- / [ *5( h16 ":" ) h16 ] "::" h16 -- / [ *6( h16 ":" ) h16 ] "::" ipV6AddressParser :: Parser Text-ipV6AddressParser = do- l <- leadingP- t <- trailingP l- joinParts l t- <?> "IPV6"+ipV6AddressParser =+ do+ l <- leadingP+ t <- trailingP l+ joinParts l t+ <?> "IPV6" where leadingP = h16 `P.sepBy` ":" trailingP = (id &&& length) >>> \l -> ipNotElided l <|> ipElided l joinParts leading trailing = pure $ (T.intercalate ":" leading) <> trailing h16 = parseBetween 1 4 (P.takeWhile isHexaDigit) ipNotElided (leading, lengthL) =- guard (lengthL == 7 && isDecOctet (last leading)) *> partialIpV4 <|>- (guard (lengthL == 8) $> mempty)+ guard (lengthL == 7 && isDecOctet (last leading)) *> partialIpV4+ <|> (guard (lengthL == 8) $> mempty) ipElided (_, lengthL) = do guard $ lengthL <= 8 elision <- P.string "::"@@ -434,8 +472,8 @@ let lengthTotal = lengthL + lengthT guard $ lengthT < 8 embeddedIpV4 <-- guard (lengthT > 0 && lengthTotal < 7 && isDecOctet (last trailing)) *> partialIpV4 <|>- pure mempty+ guard (lengthT > 0 && lengthTotal < 7 && isDecOctet (last trailing)) *> partialIpV4+ <|> pure mempty pure $ mconcat [elision, (T.intercalate ":" trailing), embeddedIpV4] partialIpV4 = mconcat <$> sequence [dotP, decOctetP, dotP, decOctetP, dotP, decOctetP] @@ -449,7 +487,6 @@ ipV4AddressParser :: Parser Text ipV4AddressParser = mconcat <$> sequence [decOctetP, dotP, decOctetP, dotP, decOctetP, dotP, decOctetP] - -- dec-octet = DIGIT ; 0-9 -- / %x31-39 DIGIT ; 10-99 -- / "1" 2DIGIT ; 100-199@@ -464,19 +501,24 @@ isDecOctet :: Text -> Bool isDecOctet s = len > 0 && T.all isDigit s && (len < 3 || (len == 3 && s <= "255"))- where len = T.length s+ where+ len = T.length s -- pct-encoded = "%" HEXDIG HEXDIG pctEncodedParser :: Parser Text pctEncodedParser = T.cons <$> P.char '%'- <*> (T.pack . fmap toUpper <$> (P.count 2 (P.satisfy isHexaDigit)))- <?> "Percent encoding"+ <*> (T.pack . fmap toUpper <$> (P.count 2 (P.satisfy isHexaDigit)))+ <?> "Percent encoding" -- unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" isUnreserved :: Char -> Bool-isUnreserved c = isAlphaNum c- || c == '-' || c == '.' || c == '_' || c == '~'+isUnreserved c =+ isAlphaNum c+ || c == '-'+ || c == '.'+ || c == '_'+ || c == '~' -- reserved = gen-delims / sub-delims -- [TODO]@@ -498,9 +540,10 @@ curry (first Just) <$> iauthorityParser <*> ipathAbEmptyParser isHexaDigit :: Char -> Bool-isHexaDigit c = (isDigit c) ||- (c >= 'a' && c <= 'f') ||- (c >= 'A' && c <= 'F')+isHexaDigit c =+ (isDigit c)+ || (c >= 'a' && c <= 'f')+ || (c >= 'A' && c <= 'F') dotP :: Parser Text dotP = P.string "."
+ src/Data/RDF/State.hs view
@@ -0,0 +1,140 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}++module Data.RDF.State where++import Control.Monad.State+import Data.RDF (RDF, Rdf, PrefixMappings, BaseUrl, Triples, Triple, NodeSelector)+import qualified Data.RDF as RDF++-- | StateT monad which allows to combine more easily functions from 'Rdf'+-- typeclass, eg.:+--+-- @+-- import Data.RDF+-- import qualified Data.RDF.State as RDFS+--+-- main :: IO ()+-- main = do+-- let myEmptyGraph = empty :: RDF TList+-- newGraph <- execStateT (unRdfST createGraph) myEmptyGraph+-- putStrLn (showGraph newGraph)+--+-- createGraph :: (Rdf rdfImpl, Monad m) => RdfST rdfImpl m ()+-- createGraph = do+-- -- add a triple to the empty graph+-- let triple1 = triple (unode "http://www.example.com/rob")+-- (unode "http://xmlns.com/foaf/0.1/interest")+-- (unode "http://dbpedia.org/resource/Scotch_whisky")+-- RDFS.addTriple triple1+--+-- -- add another triple to the graph+-- let triple2 = triple (unode "http://www.example.com/rob")+-- (unode "http://xmlns.com/foaf/0.1/interest")+-- (unode "http://dbpedia.org/resource/Haskell_(programming_language)")+-- RDFS.addTriple triple2+--+-- -- remove one of my interests+-- RDFS.removeTriple triple1+-- @+newtype RdfST rdfImpl m a = RdfST { unRdfST :: StateT (RDF rdfImpl) m a }+ deriving+ ( Functor,+ Applicative,+ Monad,+ MonadState (RDF rdfImpl),+ MonadTrans,+ MonadIO+ )++-- | Same as 'Data.RDF.Types.baseUrl'+baseUrl+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m (Maybe BaseUrl)+baseUrl = gets RDF.baseUrl++-- | Same as 'Data.RDF.Types.prefixMappings'+prefixMappings+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m PrefixMappings+prefixMappings = gets RDF.prefixMappings++-- | Same as 'Data.RDF.Types.addPrefixMappings', but with the Bool arg as False+addPrefixMappings+ :: (Rdf rdfImpl, Monad m)+ => PrefixMappings+ -> RdfST rdfImpl m ()+addPrefixMappings mappings =+ get >>= \graph -> put $ RDF.addPrefixMappings graph mappings False++-- | Same as 'Data.RDF.Types.addPrefixMappings', but with the Bool arg as True+replacePrefixMappings+ :: (Rdf rdfImpl, Monad m)+ => PrefixMappings+ -> RdfST rdfImpl m ()+replacePrefixMappings mappings =+ get >>= \graph -> put $ RDF.addPrefixMappings graph mappings True++-- | Same as 'Data.RDF.Types.empty'+empty+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m ()+empty = put RDF.empty++-- | Same as 'Data.RDF.Types.mkRdf'+mkRdf+ :: (Rdf rdfImpl, Monad m)+ => Triples+ -> Maybe BaseUrl+ -> PrefixMappings+ -> RdfST rdfImpl m ()+mkRdf triples baseUrlMaybe mappings =+ put $ RDF.mkRdf triples baseUrlMaybe mappings++-- | Same as 'Data.RDF.Types.addTriple'+addTriple+ :: (Rdf rdfImpl, Monad m)+ => Triple -> RdfST rdfImpl m ()+addTriple triple = get >>= \graph -> put $ RDF.addTriple graph triple++-- | Same as 'Data.RDF.Types.removeTriple'+removeTriple+ :: (Rdf rdfImpl, Monad m)+ => Triple -> RdfST rdfImpl m ()+removeTriple triple = get >>= \graph -> put $ RDF.removeTriple graph triple++-- | Same as 'Data.RDF.Types.triplesOf'+triplesOf+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m Triples+triplesOf = gets RDF.triplesOf++-- | Same as 'Data.RDF.Types.uniqTriplesOf'+uniqTriplesOf+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m Triples+uniqTriplesOf = gets RDF.uniqTriplesOf++-- | Same as 'Data.RDF.Types.select'+select+ :: (Rdf rdfImpl, Monad m)+ => NodeSelector+ -> NodeSelector+ -> NodeSelector+ -> RdfST rdfImpl m Triples+select s p o = get >>= \graph -> return $ RDF.select graph s p o++-- | Same as 'Data.RDF.Types.query'+query+ :: (Rdf rdfImpl, Monad m)+ => Maybe RDF.Node+ -> Maybe RDF.Node+ -> Maybe RDF.Node+ -> RdfST rdfImpl m Triples+query s p o = get >>= \graph -> return $ RDF.query graph s p o++-- | Same as 'Data.RDF.Types.showGraph'+showGraph+ :: (Rdf rdfImpl, Monad m)+ => RdfST rdfImpl m String+showGraph = gets RDF.showGraph
src/Data/RDF/Types.hs view
@@ -1,59 +1,75 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE OverloadedStrings, OverloadedLists #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-}--module Data.RDF.Types (-- -- * RDF triples, nodes and literals- LValue(PlainL,PlainLL,TypedL),- Node(UNode,BNode,BNodeGen,LNode), Subject, Predicate, Object,- Triple(Triple), Triples, View(view),+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE TypeFamilies #-} - -- * Constructor functions- plainL, plainLL, typedL,- unode, bnode, lnode, triple, unodeValidate, uriValidate, uriValidateString,+module Data.RDF.Types+ ( -- * RDF triples, nodes and literals+ LValue (PlainL, PlainLL, TypedL),+ Node (UNode, BNode, BNodeGen, LNode),+ Subject,+ Predicate,+ Object,+ Triple (Triple),+ Triples,+ View (view), - -- * Node query function- isUNode, isLNode, isBNode,+ -- * Constructor functions+ plainL,+ plainLL,+ typedL,+ unode,+ bnode,+ bnodeUnsafe,+ lnode,+ triple,+ unodeValidate,+ uriValidate,+ uriValidateString, - -- * Miscellaneous- resolveQName, isAbsoluteUri, mkAbsoluteUrl, escapeRDFSyntax, unescapeUnicode,- fileSchemeToFilePath, filePathToUri,- iriFragment, uchar,+ -- * Node query function+ isUNode,+ isLNode,+ isBNode, - -- * RDF data family- RDF,+ -- * Miscellaneous+ resolveQName,+ isAbsoluteUri,+ mkAbsoluteUrl,+ escapeRDFSyntax,+ unescapeUnicode,+ fileSchemeToFilePath,+ filePathToUri,+ iriFragment,+ uchar, - -- * Rdf type class- Rdf(baseUrl,prefixMappings,addPrefixMappings,empty,mkRdf,addTriple,removeTriple,triplesOf,uniqTriplesOf,select,query,showGraph),+ -- * RDF data family+ RDF, - -- * Parsing RDF- RdfParser(parseString,parseFile,parseURL),+ -- * Rdf type class+ Rdf (baseUrl, prefixMappings, addPrefixMappings, empty, mkRdf, addTriple, removeTriple, triplesOf, uniqTriplesOf, select, query, showGraph), - -- * Serializing RDF- RdfSerializer(hWriteRdf,writeRdf,hWriteH,writeH,hWriteTs,hWriteT,writeT, writeTs,hWriteN, writeN),+ -- * Parsing RDF+ RdfParser (parseString, parseFile, parseURL), - -- * Namespaces and Prefixes- Namespace(PrefixedNS,PlainNS),- PrefixMappings(PrefixMappings),PrefixMapping(PrefixMapping),+ -- * Serializing RDF+ RdfSerializer (hWriteRdf, writeRdf, hWriteH, writeH, hWriteTs, hWriteT, writeT, writeTs, hWriteN, writeN), - -- * Supporting types- BaseUrl(..), NodeSelector, ParseFailure(ParseFailure)+ -- * Namespaces and Prefixes+ Namespace (PrefixedNS, PlainNS),+ PrefixMappings (PrefixMappings),+ PrefixMapping (PrefixMapping), -) where+ -- * Supporting types+ BaseUrl (..),+ NodeSelector,+ ParseFailure (ParseFailure),+ )+where -import Prelude hiding (pred)-import Data.Text (Text)-import qualified Data.Text as T-import System.IO-import Text.Printf-import Data.Binary-import Data.Char (chr, ord)-import Data.Either (isRight)-import Data.String (IsString(..)) #if MIN_VERSION_base(4,9,0) #if !MIN_VERSION_base(4,11,0) import Data.Semigroup@@ -61,43 +77,51 @@ #endif #else #endif-import Data.Map (Map)-import Data.RDF.IRI-import Control.Applicative++import Control.Applicative import qualified Control.Applicative as A-import Control.Monad ((<=<), guard)-import GHC.Generics (Generic)+import Control.DeepSeq (NFData, rnf)+import Control.Monad (guard, (<=<))+import Data.Binary+import Data.Char (chr, ord)+import Data.Either (isRight) import Data.Hashable (Hashable) import qualified Data.List as List+import Data.Map (Map) import qualified Data.Map as Map+import Data.RDF.BlankNode+import Data.RDF.IRI+import Data.String (IsString (..))+import Data.Text (Text)+import qualified Data.Text as T+import GHC.Generics (Generic)+import Network.URI+import qualified Network.URI as Network (parseURI, uriPath) import qualified System.FilePath as FP-import qualified Network.URI as Network (uriPath,parseURI)-import Network.URI-import Control.DeepSeq (NFData,rnf)+import System.IO import Text.Parsec (ParseError, parse)- import Text.Parser.Char import Text.Parser.Combinators+import Text.Printf+import Prelude hiding (pred) ------------------- -- LValue and constructor functions --- |The actual value of an RDF literal, represented as the 'LValue'--- parameter of an 'LNode'.-data LValue =- -- Constructors are not exported, because we need to have more- -- control over the format of the literal text that we store.-- -- |A plain (untyped) literal value in an unspecified language.- PlainL !Text-- -- |A plain (untyped) literal value with a language specifier.- | PlainLL !Text !Text+-- | The actual value of an RDF literal, represented as the 'LValue'+-- parameter of an 'LNode'.+data LValue+ = -- Constructors are not exported, because we need to have more+ -- control over the format of the literal text that we store. - -- |A typed literal value consisting of the literal value and- -- the URI of the datatype of the value, respectively.- | TypedL !Text !Text- deriving (Generic,Show)+ -- | A plain (untyped) literal value in an unspecified language.+ PlainL !Text+ | -- | A plain (untyped) literal value with a language specifier.+ PlainLL !Text !Text+ | -- | A typed literal value consisting of the literal value and+ -- the URI of the datatype of the value, respectively.+ TypedL !Text !Text+ deriving (Generic, Show) instance Binary LValue @@ -106,19 +130,19 @@ rnf (PlainLL t1 t2) = rnf t1 `seq` rnf t2 rnf (TypedL t1 t2) = rnf t1 `seq` rnf t2 --- |Return a PlainL LValue for the given string value.+-- | Return a PlainL LValue for the given string value. {-# INLINE plainL #-} plainL :: Text -> LValue-plainL = PlainL+plainL = PlainL --- |Return a PlainLL LValue for the given string value and language,--- respectively.+-- | Return a PlainLL LValue for the given string value and language,+-- respectively. {-# INLINE plainLL #-} plainLL :: Text -> Text -> LValue plainLL = PlainLL --- |Return a TypedL LValue for the given string value and datatype URI,--- respectively.+-- | Return a TypedL LValue for the given string value and datatype URI,+-- respectively. {-# INLINE typedL #-} typedL :: Text -> Text -> LValue typedL val dtype = TypedL (canonicalize dtype val) dtype@@ -126,29 +150,25 @@ ------------------- -- Node and constructor functions --- |An RDF node, which may be either a URIRef node ('UNode'), a blank--- node ('BNode'), or a literal node ('LNode').-data Node =-- -- |An RDF URI reference. URIs conform to the RFC3986 standard. See- -- <http://www.w3.org/TR/rdf-concepts/#section-Graph-URIref> for more- -- information.- UNode !Text-- -- |An RDF blank node. See- -- <http://www.w3.org/TR/rdf-concepts/#section-blank-nodes> for more- -- information.- | BNode !Text-- -- |An RDF blank node with an auto-generated identifier, as used in- -- Turtle.- | BNodeGen !Int-- -- |An RDF literal. See- -- <http://www.w3.org/TR/rdf-concepts/#section-Graph-Literal> for more- -- information.- | LNode !LValue- deriving (Generic,Show)+-- | An RDF node, which may be either a URIRef node ('UNode'), a blank+-- node ('BNode'), or a literal node ('LNode').+data Node+ = -- | An RDF URI reference. URIs conform to the RFC3986 standard. See+ -- <http://www.w3.org/TR/rdf-concepts/#section-Graph-URIref> for more+ -- information.+ UNode !Text+ | -- | An RDF blank node. See+ -- <http://www.w3.org/TR/rdf-concepts/#section-blank-nodes> for more+ -- information.+ BNode !Text+ | -- | An RDF blank node with an auto-generated identifier, as used in+ -- Turtle.+ BNodeGen !Int+ | -- | An RDF literal. See+ -- <http://www.w3.org/TR/rdf-concepts/#section-Graph-Literal> for more+ -- information.+ LNode !LValue+ deriving (Generic, Show) instance Binary Node @@ -158,16 +178,16 @@ rnf (BNodeGen bgen) = rnf bgen rnf (LNode lvalue) = rnf lvalue --- |An alias for 'Node', defined for convenience and readability purposes.+-- | An alias for 'Node', defined for convenience and readability purposes. type Subject = Node --- |An alias for 'Node', defined for convenience and readability purposes.+-- | An alias for 'Node', defined for convenience and readability purposes. type Predicate = Node --- |An alias for 'Node', defined for convenience and readability purposes.+-- | An alias for 'Node', defined for convenience and readability purposes. type Object = Node --- |Return a URIRef node for the given URI.+-- | Return a URIRef node for the given URI. {-# INLINE unode #-} unode :: Text -> Node unode = UNode@@ -179,26 +199,26 @@ -- inherited by the NTriples and XML specification. -- http://www.w3.org/TR/turtle/#sec-escapes --- |Validate a URI and return it in a @Just UNode@ if it is--- valid, otherwise @Nothing@ is returned. Performs the following:+-- | Validate a URI and return it in a @Just UNode@ if it is+-- valid, otherwise @Nothing@ is returned. Performs the following: ----- 1. unescape unicode RDF literals--- 2. checks validity of this unescaped URI using 'isURI' from 'Network.URI'--- 3. if the unescaped URI is valid then 'Node' constructed with 'UNode'+-- 1. unescape unicode RDF literals+-- 2. checks validity of this unescaped URI using 'isURI' from 'Network.URI'+-- 3. if the unescaped URI is valid then 'Node' constructed with 'UNode' unodeValidate :: Text -> Maybe Node unodeValidate t = UNode <$> uriValidate t --- |Validate a Text URI and return it in a @Just Text@ if it is--- valid, otherwise @Nothing@ is returned. See 'unodeValidate'.+-- | Validate a Text URI and return it in a @Just Text@ if it is+-- valid, otherwise @Nothing@ is returned. See 'unodeValidate'. uriValidate :: Text -> Maybe Text uriValidate = either (const Nothing) Just . isRdfURI --- |Same as 'uriValidate', but on 'String' rather than 'Text'+-- | Same as 'uriValidate', but on 'String' rather than 'Text' uriValidateString :: String -> Maybe String uriValidateString = fmap T.unpack . uriValidate . fromString isRdfURI :: Text -> Either ParseError Text-isRdfURI t = parse (iriFragment <* eof) ("Invalid URI: " <> T.unpack t) t+isRdfURI t = parse (iriFragment <* eof) ("Invalid URI: " <> T.unpack t) t -- IRIREF from NTriples spec (without <> enclosing) -- [8] IRIREF ::= '<' ([^#x00-#x20<>"{}|^`\] | UCHAR)* '>'@@ -212,14 +232,15 @@ return c isValidUriChar c = not (c >= '\x00' && c <= '\x20')- && c `notElem` ("<>\"{}|^`\\" :: String)+ && c `notElem` ("<>\"{}|^`\\" :: String) -- UCHAR from NTriples spec -- [10] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX uchar :: (CharParsing m, Monad m) => m Char uchar = try shortUnicode <|> try longUnicode- where shortUnicode = string "\\u" *> unescapeUnicodeParser 4- longUnicode = string "\\U" *> unescapeUnicodeParser 8+ where+ shortUnicode = string "\\u" *> unescapeUnicodeParser 4+ longUnicode = string "\\U" *> unescapeUnicodeParser 8 unescapeUnicodeParser :: (CharParsing m, Monad m) => Int -> m Char unescapeUnicodeParser n = do@@ -234,242 +255,268 @@ let t' = t * 16 + h seq t' <$> go (k - 1) t' {-# INLINE getHex #-}- getHex c | '0' <= c && c <= '9' = pure (ord c - ord '0')- | 'A' <= c && c <= 'F' = pure (ord c - ord 'A' + 10)- | 'a' <= c && c <= 'f' = pure (ord c - ord 'a' + 10)- | otherwise = A.empty+ getHex c+ | '0' <= c && c <= '9' = pure (ord c - ord '0')+ | 'A' <= c && c <= 'F' = pure (ord c - ord 'A' + 10)+ | 'a' <= c && c <= 'f' = pure (ord c - ord 'a' + 10)+ | otherwise = A.empty -- | Unescapes @\Uxxxxxxxx@ and @\uxxxx@ character sequences according -- to the RDF specification. unescapeUnicode, escapeRDFSyntax :: Text -> Either ParseError Text unescapeUnicode t = T.pack <$> parse (many unicodeEsc) "" t- where unicodeEsc = uchar <|> anyChar+ where+ unicodeEsc = uchar <|> anyChar {-# DEPRECATED escapeRDFSyntax "Use unescapeUnicode instead" #-} escapeRDFSyntax = unescapeUnicode --- |Return a blank node using the given string identifier.+-- | Creates a blank node 'BNode' with a given label. Checks that+-- label is a syntactically valid label for a blank node i.e. a+-- BLANK_NODE_LABEL in+-- https://www.w3.org/TR/n-triples/#n-triples-grammar . Returns+-- 'Nothing' for invalid blank node labels. Blank node labels are+-- written as "_:abc" for a blank node with label "abc" see+-- https://www.w3.org/TR/sparql11-query/#QSynBlankNodes .+--+-- >>> bnode "_:abc"+-- Just (BNode "abc")+--+-- >>> bnode "abc"+-- Nothing+--+-- This does not check that the blank node label is unique for a+-- graph, since the function is not associated with a graph. {-# INLINE bnode #-}-bnode :: Text -> Node-bnode = BNode+bnode :: Text -> Maybe Node+bnode t =+ case mkBNode t of+ Nothing -> Nothing+ Just bString -> Just (BNode (T.pack bString)) --- |Return a literal node using the given LValue.+-- | Return a blank node using the given label. Does not check that+-- label is a syntactically valid label for a blank node i.e. a+-- BLANK_NODE_LABEL in+-- https://www.w3.org/TR/n-triples/#n-triples-grammar .+{-# INLINE bnodeUnsafe #-}+bnodeUnsafe :: Text -> Node+bnodeUnsafe = BNode++-- | Return a literal node using the given LValue. {-# INLINE lnode #-}-lnode :: LValue -> Node+lnode :: LValue -> Node lnode = LNode ------------------- -- Triple and constructor functions --- |An RDF triple is a statement consisting of a subject, predicate,--- and object, respectively.+-- | An RDF triple is a statement consisting of a subject, predicate,+-- and object, respectively. ----- See <http://www.w3.org/TR/rdf-concepts/#section-triples> for--- more information.+-- See <http://www.w3.org/TR/rdf-concepts/#section-triples> for+-- more information. data Triple = Triple !Node !Node !Node- deriving (Generic,Show)+ deriving (Generic, Show) instance Binary Triple instance NFData Triple where rnf (Triple s p o) = rnf s `seq` rnf p `seq` rnf o --- |A list of triples. This is defined for convenience and readability.+-- | A list of triples. This is defined for convenience and readability. type Triples = [Triple] --- |A smart constructor function for 'Triple' that verifies the node arguments--- are of the correct type and creates the new 'Triple' if so or calls 'error'.--- /subj/ must be a 'UNode' or 'BNode', and /pred/ must be a 'UNode'.+-- | A smart constructor function for 'Triple' that verifies the node arguments+-- are of the correct type and creates the new 'Triple' if so or calls 'error'.+-- /subj/ must be a 'UNode' or 'BNode', and /pred/ must be a 'UNode'. triple :: Subject -> Predicate -> Object -> Triple triple s p o- | isLNode s = error $ "subject must be UNode or BNode: " <> show s+ | isLNode s = error $ "subject must be UNode or BNode: " <> show s | isLNode p = error $ "predicate must be UNode, not LNode: " <> show p | isBNode p = error $ "predicate must be UNode, not BNode: " <> show p- | otherwise = Triple s p o+ | otherwise = Triple s p o --- |Answer if given node is a URI Ref node.+-- | Answer if given node is a URI Ref node. {-# INLINE isUNode #-} isUNode :: Node -> Bool isUNode (UNode _) = True-isUNode _ = False+isUNode _ = False --- |Answer if given node is a blank node.+-- | Answer if given node is a blank node. {-# INLINE isBNode #-} isBNode :: Node -> Bool-isBNode (BNode _) = True+isBNode (BNode _) = True isBNode (BNodeGen _) = True-isBNode _ = False+isBNode _ = False --- |Answer if given node is a literal node.+-- | Answer if given node is a literal node. {-# INLINE isLNode #-} isLNode :: Node -> Bool isLNode (LNode _) = True-isLNode _ = False+isLNode _ = False {-# INLINE isAbsoluteUri #-}+ -- | returns @True@ if URI is absolute. isAbsoluteUri :: Text -> Bool isAbsoluteUri = isRight . parseIRI --- |A type class for ADTs that expose views to clients.+-- | A type class for ADTs that expose views to clients. class View a b where view :: a -> b --- |RDF data family+-- | RDF data family data family RDF a --- |An RDF value is a set of (unique) RDF triples, together with the--- operations defined upon them.+-- | An RDF value is a set of (unique) RDF triples, together with the+-- operations defined upon them. ----- For information about the efficiency of the functions, see the--- documentation for the particular RDF instance.+-- For information about the efficiency of the functions, see the+-- documentation for the particular RDF instance. ----- For more information about the concept of an RDF graph, see--- the following: <http://www.w3.org/TR/rdf-concepts/#section-rdf-graph>.+-- For more information about the concept of an RDF graph, see+-- the following: <http://www.w3.org/TR/rdf-concepts/#section-rdf-graph>. class (Generic rdfImpl, NFData rdfImpl) => Rdf rdfImpl where-- -- |Return the base URL of this RDF, if any.+ -- | Return the base URL of this RDF, if any. baseUrl :: RDF rdfImpl -> Maybe BaseUrl - -- |Return the prefix mappings defined for this RDF, if any.+ -- | Return the prefix mappings defined for this RDF, if any. prefixMappings :: RDF rdfImpl -> PrefixMappings - -- |Return an RDF with the specified prefix mappings merged with- -- the existing mappings. If the Bool arg is True, then a new mapping- -- for an existing prefix will replace the old mapping; otherwise,- -- the new mapping is ignored.+ -- | Return an RDF with the specified prefix mappings merged with+ -- the existing mappings. If the Bool arg is True, then a new mapping+ -- for an existing prefix will replace the old mapping; otherwise,+ -- the new mapping is ignored. addPrefixMappings :: RDF rdfImpl -> PrefixMappings -> Bool -> RDF rdfImpl - -- |Return an empty RDF.+ -- | Return an empty RDF. empty :: RDF rdfImpl - -- |Return a RDF containing all the given triples. Handling of duplicates- -- in the input depend on the particular RDF implementation.+ -- | Return a RDF containing all the given triples. Handling of duplicates+ -- in the input depend on the particular RDF implementation. mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF rdfImpl - -- |Adds a triple to an RDF graph.+ -- | Adds a triple to an RDF graph. addTriple :: RDF rdfImpl -> Triple -> RDF rdfImpl - -- |Removes all occurrences of a triple in an RDF graph.+ -- | Removes all occurrences of a triple in an RDF graph. removeTriple :: RDF rdfImpl -> Triple -> RDF rdfImpl - -- |Return all triples in the RDF, as a list.+ -- | Return all triples in the RDF, as a list. --- -- Note that this function returns a list of triples in the RDF as they- -- were added, without removing duplicates and without expanding namespaces.+ -- Note that this function returns a list of triples in the RDF as they+ -- were added, without removing duplicates and without expanding namespaces. triplesOf :: RDF rdfImpl -> Triples - -- |Return unique triples in the RDF, as a list.+ -- | Return unique triples in the RDF, as a list. --- -- This function performs namespace expansion and removal of duplicates.+ -- This function performs namespace expansion and removal of duplicates. uniqTriplesOf :: RDF rdfImpl -> Triples - -- |Select the triples in the RDF that match the given selectors.+ -- | Select the triples in the RDF that match the given selectors. --- -- The three NodeSelector parameters are optional functions that match- -- the respective subject, predicate, and object of a triple. The triples- -- returned are those in the given graph for which the first selector- -- returns true when called on the subject, the second selector returns- -- true when called on the predicate, and the third selector returns true- -- when called on the ojbect. A 'Nothing' parameter is equivalent to a- -- function that always returns true for the appropriate node; but- -- implementations may be able to much more efficiently answer a select- -- that involves a 'Nothing' parameter rather than an @(id True)@ parameter.+ -- The three NodeSelector parameters are optional functions that match+ -- the respective subject, predicate, and object of a triple. The triples+ -- returned are those in the given graph for which the first selector+ -- returns true when called on the subject, the second selector returns+ -- true when called on the predicate, and the third selector returns true+ -- when called on the ojbect. A 'Nothing' parameter is equivalent to a+ -- function that always returns true for the appropriate node; but+ -- implementations may be able to much more efficiently answer a select+ -- that involves a 'Nothing' parameter rather than an @(id True)@ parameter. --- -- The following call illustrates the use of select, and would result in- -- the selection of all and only the triples that have a blank node- -- as subject and a literal node as object:+ -- The following call illustrates the use of select, and would result in+ -- the selection of all and only the triples that have a blank node+ -- as subject and a literal node as object: --- -- > select gr (Just isBNode) Nothing (Just isLNode)+ -- > select gr (Just isBNode) Nothing (Just isLNode) --- -- Note: this function may be very slow; see the documentation for the- -- particular RDF implementation for more information.+ -- Note: this function may be very slow; see the documentation for the+ -- particular RDF implementation for more information. select :: RDF rdfImpl -> NodeSelector -> NodeSelector -> NodeSelector -> Triples - -- |Return the triples in the RDF that match the given pattern, where- -- the pattern (3 Maybe Node parameters) is interpreted as a triple pattern.+ -- | Return the triples in the RDF that match the given pattern, where+ -- the pattern (3 Maybe Node parameters) is interpreted as a triple pattern. --- -- The @Maybe Node@ params are interpreted as the subject, predicate, and- -- object of a triple, respectively. @Just n@ is true iff the triple has- -- a node equal to @n@ in the appropriate location; @Nothing@ is always- -- true, regardless of the node in the appropriate location.+ -- The @Maybe Node@ params are interpreted as the subject, predicate, and+ -- object of a triple, respectively. @Just n@ is true iff the triple has+ -- a node equal to @n@ in the appropriate location; @Nothing@ is always+ -- true, regardless of the node in the appropriate location. --- -- For example, @ query rdf (Just n1) Nothing (Just n2) @ would return all- -- and only the triples that have @n1@ as subject and @n2@ as object,- -- regardless of the predicate of the triple.+ -- For example, @ query rdf (Just n1) Nothing (Just n2) @ would return all+ -- and only the triples that have @n1@ as subject and @n2@ as object,+ -- regardless of the predicate of the triple. query :: RDF rdfImpl -> Maybe Node -> Maybe Node -> Maybe Node -> Triples - -- |pretty prints the RDF graph+ -- | pretty prints the RDF graph showGraph :: RDF rdfImpl -> String instance (Rdf a) => Show (RDF a) where show = showGraph --- |An RdfParser is a parser that knows how to parse 1 format of RDF and--- can parse an RDF document of that type from a string, a file, or a URL.--- Required configuration options will vary from instance to instance.+-- | An RdfParser is a parser that knows how to parse 1 format of RDF and+-- can parse an RDF document of that type from a string, a file, or a URL.+-- Required configuration options will vary from instance to instance. class RdfParser p where-- -- |Parse RDF from the given text, yielding a failure with error message or- -- the resultant RDF.+ -- | Parse RDF from the given text, yielding a failure with error message or+ -- the resultant RDF. parseString :: (Rdf a) => p -> Text -> Either ParseFailure (RDF a) - -- |Parse RDF from the local file with the given path, yielding a failure with error- -- message or the resultant RDF in the IO monad.+ -- | Parse RDF from the local file with the given path, yielding a failure with error+ -- message or the resultant RDF in the IO monad. parseFile :: (Rdf a) => p -> String -> IO (Either ParseFailure (RDF a)) - -- |Parse RDF from the remote file with the given HTTP URL (https is not supported),- -- yielding a failure with error message or the resultant graph in the IO monad.+ -- | Parse RDF from the remote file with the given HTTP URL (https is not supported),+ -- yielding a failure with error message or the resultant graph in the IO monad. parseURL :: (Rdf a) => p -> String -> IO (Either ParseFailure (RDF a)) --- |An RdfSerializer is a serializer of RDF to some particular output format, such as--- NTriples or Turtle.+-- | An RdfSerializer is a serializer of RDF to some particular output format, such as+-- NTriples or Turtle. class RdfSerializer s where- -- |Write the RDF to a file handle using whatever configuration is specified by- -- the first argument.+ -- | Write the RDF to a file handle using whatever configuration is specified by+ -- the first argument. hWriteRdf :: (Rdf a) => s -> Handle -> RDF a -> IO () - -- |Write the RDF to stdout; equivalent to @'hWriteRdf' stdout@.+ -- | Write the RDF to stdout; equivalent to @'hWriteRdf' stdout@. writeRdf :: (Rdf a) => s -> RDF a -> IO () - -- |Write to the file handle whatever header information is required based on- -- the output format. For example, if serializing to Turtle, this method would- -- write the necessary \@prefix declarations and possibly a \@baseUrl declaration,- -- whereas for NTriples, there is no header section at all, so this would be a no-op.+ -- | Write to the file handle whatever header information is required based on+ -- the output format. For example, if serializing to Turtle, this method would+ -- write the necessary \@prefix declarations and possibly a \@baseUrl declaration,+ -- whereas for NTriples, there is no header section at all, so this would be a no-op. hWriteH :: (Rdf a) => s -> Handle -> RDF a -> IO () - -- |Write header information to stdout; equivalent to @'hWriteRdf' stdout@.+ -- | Write header information to stdout; equivalent to @'hWriteRdf' stdout@. writeH :: (Rdf a) => s -> RDF a -> IO () - -- |Write some triples to a file handle using whatever configuration is specified- -- by the first argument.+ -- | Write some triples to a file handle using whatever configuration is specified+ -- by the first argument. --- -- WARNING: if the serialization format has header-level information- -- that should be output (e.g., \@prefix declarations for Turtle), then you should- -- use 'hWriteG' instead of this method unless you're sure this is safe to use, since- -- otherwise the resultant document will be missing the header information and- -- will not be valid.- hWriteTs :: s -> Handle -> Triples -> IO ()+ -- WARNING: if the serialization format has header-level information+ -- that should be output (e.g., \@prefix declarations for Turtle), then you should+ -- use 'hWriteG' instead of this method unless you're sure this is safe to use, since+ -- otherwise the resultant document will be missing the header information and+ -- will not be valid.+ hWriteTs :: s -> Handle -> Triples -> IO () - -- |Write some triples to stdout; equivalent to @'hWriteTs' stdout@.+ -- | Write some triples to stdout; equivalent to @'hWriteTs' stdout@. writeTs :: s -> Triples -> IO () - -- |Write a single triple to the file handle using whatever configuration is- -- specified by the first argument. The same WARNING applies as to 'hWriteTs'.- hWriteT :: s -> Handle -> Triple -> IO ()-- -- |Write a single triple to stdout; equivalent to @'hWriteT' stdout@.- writeT :: s -> Triple -> IO ()+ -- | Write a single triple to the file handle using whatever configuration is+ -- specified by the first argument. The same WARNING applies as to 'hWriteTs'.+ hWriteT :: s -> Handle -> Triple -> IO () - -- |Write a single node to the file handle using whatever configuration is- -- specified by the first argument. The same WARNING applies as to 'hWriteTs'.- hWriteN :: s -> Handle -> Node -> IO ()+ -- | Write a single triple to stdout; equivalent to @'hWriteT' stdout@.+ writeT :: s -> Triple -> IO () - -- |Write a single node to sdout; equivalent to @'hWriteN' stdout@.- writeN :: s -> Node -> IO ()+ -- | Write a single node to the file handle using whatever configuration is+ -- specified by the first argument. The same WARNING applies as to 'hWriteTs'.+ hWriteN :: s -> Handle -> Node -> IO () + -- | Write a single node to sdout; equivalent to @'hWriteN' stdout@.+ writeN :: s -> Node -> IO () --- |The base URL of an RDF.-newtype BaseUrl = BaseUrl { unBaseUrl :: Text }+-- | The base URL of an RDF.+newtype BaseUrl = BaseUrl {unBaseUrl :: Text} deriving (Eq, Ord, Show, NFData, Semigroup, Generic) instance Binary BaseUrl@@ -477,108 +524,109 @@ instance Monoid BaseUrl where mempty = BaseUrl T.empty --- |A 'NodeSelector' is either a function that returns 'True'--- or 'False' for a node, or Nothing, which indicates that all--- nodes would return 'True'.+-- | A 'NodeSelector' is either a function that returns 'True'+-- or 'False' for a node, or Nothing, which indicates that all+-- nodes would return 'True'. ----- The selector is said to select, or match, the nodes for--- which it returns 'True'.+-- The selector is said to select, or match, the nodes for+-- which it returns 'True'. ----- When used in conjunction with the 'select' method of 'Graph', three--- node selectors are used to match a triple.+-- When used in conjunction with the 'select' method of 'Graph', three+-- node selectors are used to match a triple. type NodeSelector = Maybe (Node -> Bool) --- |Represents a failure in parsing an N-Triples document, including--- an error message with information about the cause for the failure.+-- | Represents a failure in parsing an N-Triples document, including+-- an error message with information about the cause for the failure. newtype ParseFailure = ParseFailure String deriving (Eq, Show) --- |A node is equal to another node if they are both the same type--- of node and if the field values are equal.+-- | A node is equal to another node if they are both the same type+-- of node and if the field values are equal. instance Eq Node where- (UNode bs1) == (UNode bs2) = bs1 == bs2- (BNode bs1) == (BNode bs2) = bs1 == bs2- (BNodeGen i1) == (BNodeGen i2) = i1 == i2- (LNode l1) == (LNode l2) = l1 == l2- _ == _ = False+ (UNode bs1) == (UNode bs2) = bs1 == bs2+ (BNode bs1) == (BNode bs2) = bs1 == bs2+ (BNodeGen i1) == (BNodeGen i2) = i1 == i2+ (LNode l1) == (LNode l2) = l1 == l2+ _ == _ = False --- |Node ordering is defined first by type, with Unode < BNode < BNodeGen--- < LNode PlainL < LNode PlainLL < LNode TypedL, and secondly by--- the natural ordering of the node value.+-- | Node ordering is defined first by type, with Unode < BNode < BNodeGen+-- < LNode PlainL < LNode PlainLL < LNode TypedL, and secondly by+-- the natural ordering of the node value. ----- E.g., a '(UNode _)' is LT any other type of node, and a--- '(LNode (TypedL _ _))' is GT any other type of node, and the ordering--- of '(BNodeGen 44)' and '(BNodeGen 3)' is that of the values, or--- 'compare 44 3', GT.+-- E.g., a '(UNode _)' is LT any other type of node, and a+-- '(LNode (TypedL _ _))' is GT any other type of node, and the ordering+-- of '(BNodeGen 44)' and '(BNodeGen 3)' is that of the values, or+-- 'compare 44 3', GT. instance Ord Node where- compare (UNode bs1) (UNode bs2) = compare bs1 bs2- compare (UNode _) _ = LT- compare _ (UNode _) = GT- compare (BNode bs1) (BNode bs2) = compare bs1 bs2- compare (BNode _) _ = LT- compare _ (BNode _) = GT- compare (BNodeGen i1) (BNodeGen i2) = compare i1 i2- compare (BNodeGen _) _ = LT- compare _ (BNodeGen _) = GT- compare (LNode lv1) (LNode lv2) = compare lv1 lv2+ compare (UNode bs1) (UNode bs2) = compare bs1 bs2+ compare (UNode _) _ = LT+ compare _ (UNode _) = GT+ compare (BNode bs1) (BNode bs2) = compare bs1 bs2+ compare (BNode _) _ = LT+ compare _ (BNode _) = GT+ compare (BNodeGen i1) (BNodeGen i2) = compare i1 i2+ compare (BNodeGen _) _ = LT+ compare _ (BNodeGen _) = GT+ compare (LNode lv1) (LNode lv2) = compare lv1 lv2 instance Hashable Node --- |Two triples are equal iff their respective subjects, predicates, and objects--- are equal.+-- | Two triples are equal iff their respective subjects, predicates, and objects+-- are equal. instance Eq Triple where (Triple s1 p1 o1) == (Triple s2 p2 o2) = s1 == s2 && p1 == p2 && o1 == o2 --- |The ordering of triples is based on that of the subject, predicate, and object--- of the triple, in that order.+-- | The ordering of triples is based on that of the subject, predicate, and object+-- of the triple, in that order. instance Ord Triple where {-# INLINE compare #-} (Triple s1 p1 o1) `compare` (Triple s2 p2 o2) = compare s1 s2 `mappend` compare p1 p2 `mappend` compare o1 o2 --- |Two 'LValue' values are equal iff they are of the same type and all fields are equal.+-- | Two 'LValue' values are equal iff they are of the same type and all fields are equal. instance Eq LValue where- (PlainL v1) == (PlainL v2) = v1 == v2- (PlainLL v1 lt1) == (PlainLL v2 lt2) = T.toLower lt1 == T.toLower lt2 && v1 == v2- (TypedL v1 dt1) == (TypedL v2 dt2) = v1 == v2 && dt1 == dt2- _ == _ = False+ (PlainL v1) == (PlainL v2) = v1 == v2+ (PlainLL v1 lt1) == (PlainLL v2 lt2) = T.toLower lt1 == T.toLower lt2 && v1 == v2+ (TypedL v1 dt1) == (TypedL v2 dt2) = v1 == v2 && dt1 == dt2+ _ == _ = False --- |Ordering of 'LValue' values is as follows: (PlainL _) < (PlainLL _ _)--- < (TypedL _ _), and values of the same type are ordered by field values,--- with '(PlainLL literalValue language)' being ordered by language first and--- literal value second, and '(TypedL literalValue datatypeUri)' being ordered--- by datatype first and literal value second.+-- | Ordering of 'LValue' values is as follows: (PlainL _) < (PlainLL _ _)+-- < (TypedL _ _), and values of the same type are ordered by field values,+-- with '(PlainLL literalValue language)' being ordered by language first and+-- literal value second, and '(TypedL literalValue datatypeUri)' being ordered+-- by datatype first and literal value second. instance Ord LValue where {-# INLINE compare #-}- compare (PlainL v1) (PlainL v2) = compare v1 v2- compare (PlainL _) _ = LT- compare _ (PlainL _) = GT+ compare (PlainL v1) (PlainL v2) = compare v1 v2+ compare (PlainL _) _ = LT+ compare _ (PlainL _) = GT compare (PlainLL v1 lt1) (PlainLL v2 lt2) = compare lt1 lt2 `mappend` compare v1 v2- compare (PlainLL _ _) _ = LT- compare _ (PlainLL _ _) = GT- compare (TypedL v1 dt1) (TypedL v2 dt2) = compare dt1 dt2 `mappend` compare v1 v2+ compare (PlainLL _ _) _ = LT+ compare _ (PlainLL _ _) = GT+ compare (TypedL v1 dt1) (TypedL v2 dt2) = compare dt1 dt2 `mappend` compare v1 v2 instance Hashable LValue ------------------------ -- Prefix mappings --- |Represents a namespace as either a prefix and uri, respectively,--- or just a uri.-data Namespace = PrefixedNS Text Text -- prefix and ns uri- | PlainNS Text -- ns uri alone+-- | Represents a namespace as either a prefix and uri, respectively,+-- or just a uri.+data Namespace+ = PrefixedNS Text Text -- prefix and ns uri+ | PlainNS Text -- ns uri alone instance Eq Namespace where- (PrefixedNS _ u1) == (PrefixedNS _ u2) = u1 == u2- (PlainNS u1) == (PlainNS u2) = u1 == u2- (PrefixedNS _ u1) == (PlainNS u2) = u1 == u2- (PlainNS u1) == (PrefixedNS _ u2) = u1 == u2+ (PrefixedNS _ u1) == (PrefixedNS _ u2) = u1 == u2+ (PlainNS u1) == (PlainNS u2) = u1 == u2+ (PrefixedNS _ u1) == (PlainNS u2) = u1 == u2+ (PlainNS u1) == (PrefixedNS _ u2) = u1 == u2 instance Show Namespace where- show (PlainNS uri) = T.unpack uri- show (PrefixedNS prefix uri) = printf "(PrefixNS %s %s)" (T.unpack prefix) (T.unpack uri)+ show (PlainNS uri) = T.unpack uri+ show (PrefixedNS prefix uri) = printf "(PrefixNS %s %s)" (T.unpack prefix) (T.unpack uri) --- |An alias for a map from prefix to namespace URI.+-- | An alias for a map from prefix to namespace URI. newtype PrefixMappings = PrefixMappings (Map Text Text) deriving (Eq, Ord, NFData, Semigroup, Monoid, Generic) @@ -588,12 +636,14 @@ -- This is really inefficient, but it's not used much so not what -- worth optimizing yet. show (PrefixMappings pmap) = printf "PrefixMappings [%s]" mappingsStr- where showPM = show . PrefixMapping- mappingsStr = List.intercalate ", " (fmap showPM (Map.toList pmap))+ where+ showPM = show . PrefixMapping+ mappingsStr = List.intercalate ", " (fmap showPM (Map.toList pmap)) --- |A mapping of a prefix to the URI for that prefix.+-- | A mapping of a prefix to the URI for that prefix. newtype PrefixMapping = PrefixMapping (Text, Text) deriving (Eq, Ord)+ instance Show PrefixMapping where show (PrefixMapping (prefix, uri)) = printf "PrefixMapping (%s, %s)" (show prefix) (show uri) @@ -606,6 +656,7 @@ {-# INLINE mkAbsoluteUrl #-} {-# DEPRECATED mkAbsoluteUrl "Use resolveIRI instead, because mkAbsoluteUrl is a partial function" #-}+ -- | Make an absolute URL by returning as is if already an absolute URL and otherwise -- appending the URL to the given base URL. mkAbsoluteUrl :: Text -> Text -> Text@@ -614,8 +665,8 @@ ----------------- -- Internal canonicalize functions, don't export --- |Canonicalize the given 'Text' value using the 'Text'--- as the datatype URI.+-- | Canonicalize the given 'Text' value using the 'Text'+-- as the datatype URI. {-# NOINLINE canonicalize #-} canonicalize :: Text -> Text -> Text canonicalize typeTxt litValue =@@ -631,24 +682,24 @@ where integerUri = "http://www.w3.org/2001/XMLSchema#integer" decimalUri = "http://www.w3.org/2001/XMLSchema#decimal"- doubleUri = "http://www.w3.org/2001/XMLSchema#double"+ doubleUri = "http://www.w3.org/2001/XMLSchema#double" _integerStr, _decimalStr, _doubleStr :: Text -> Text _integerStr t- | T.length t == 1 = t- | T.head t == '0' = _integerStr (T.tail t)- | otherwise = t-+ | T.length t == 1 = t+ | T.head t == '0' = _integerStr (T.tail t)+ | otherwise = t -- exponent: [eE] ('-' | '+')? [0-9]+ -- ('-' | '+') ? ( [0-9]+ '.' [0-9]* exponent | '.' ([0-9])+ exponent | ([0-9])+ exponent ) _doubleStr s = T.pack $ show (read $ T.unpack s :: Double)- -- ('-' | '+')? ( [0-9]+ '.' [0-9]* | '.' ([0-9])+ | ([0-9])+ )-_decimalStr s = -- haskell double parser doesn't handle '1.'..,- case T.last s of -- so we add a zero if that's the case and then parse+_decimalStr s =+ -- haskell double parser doesn't handle '1.'..,+ case T.last s of -- so we add a zero if that's the case and then parse '.' -> f (s `T.snoc` '0')- _ -> f s- where f s' = T.pack $ show (read $ T.unpack s' :: Double)+ _ -> f s+ where+ f s' = T.pack $ show (read $ T.unpack s' :: Double) -- | Removes "file://" schema from URIs in 'UNode' nodes fileSchemeToFilePath :: (IsString s) => Node -> Maybe s@@ -659,23 +710,23 @@ textToFilePath = pure . fromString <=< stringToFilePath . T.unpack stringToFilePath = fixPrefix <=< pure . unEscapeString . Network.uriPath <=< Network.parseURI fixPrefix "" = Nothing- fixPrefix p@(p':p'')+ fixPrefix p@(p' : p'') | p' == FP.pathSeparator = Just (FP.normalise p) -- Posix path- | p' == '/' = Just (FP.normalise p'') -- Windows classic Path- | otherwise = Just ("\\\\" <> FP.normalise p) -- Windows UNC Path+ | p' == '/' = Just (FP.normalise p'') -- Windows classic Path+ | otherwise = Just ("\\\\" <> FP.normalise p) -- Windows UNC Path fileSchemeToFilePath _ = Nothing -- | Converts a file path to a URI with "file:" scheme filePathToUri :: (IsString s) => FilePath -> Maybe s filePathToUri p | FP.isRelative p = Nothing- | otherwise = Just . fromString . as_uri . FP.normalise $ p+ | otherwise = Just . fromString . as_uri . FP.normalise $ p where as_uri = ("file://" <>) . escapeURIString isAllowedInURI . as_posix . fix_prefix fix_prefix p' = case (FP.takeDrive p') of "/" -> p'- '\\':'\\':_ -> drop 2 p'- _ -> '/':p'+ '\\' : '\\' : _ -> drop 2 p'+ _ -> '/' : p' as_posix = fmap repl repl '\\' = '/' repl c = c
+ src/Data/RDF/Vocabulary/DCTerms.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.DCTerms where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/dcterms.ttl")
+ src/Data/RDF/Vocabulary/FOAF.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.FOAF where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/foaf.ttl")
+ src/Data/RDF/Vocabulary/Generator/VocabularyGenerator.hs view
@@ -0,0 +1,162 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE ScopedTypeVariables #-}++module Data.RDF.Vocabulary.Generator.VocabularyGenerator+ ( genVocabulary,+ )+where++import Data.Char (isLower)+import Data.List (nub)+import qualified Data.Map as M+import Data.Maybe (maybeToList)+import Data.RDF+ ( AdjHashMap,+ Node (UNode),+ PrefixMappings (PrefixMappings),+ RDF,+ Rdf,+ TurtleParser (TurtleParser),+ parseFile,+ prefixMappings,+ subjectOf,+ triplesOf,+ )+import Data.Text (Text)+import qualified Data.Text as T+import Language.Haskell.TH++-- | Generates 'Node' values for concepts and properties, and+-- 'Namespace' values, for a given schema in the Haskell module in+-- which 'genVocabulary' is used.+--+-- Concepts in the schema are prepended with "_", the names of+-- properties are unchanged.+--+-- For example:+--+-- >>> $(genVocabulary "resources/shacl.ttl")+--+-- creates many 'Node' values including+--+-- @+-- _SPARQLConstraint :: Node+-- annotationProperty :: Node+-- @+--+-- This is used to auto-generate all modules in Data.RDF.Vocabulary.* at+-- compile time with Template Haskell.+genVocabulary ::+ -- | the filepath of the file containing the schema in RDF Turtle format.+ String ->+ Q [Dec]+genVocabulary file = vocabulary <$> runIO (loadGraph file)++loadGraph :: String -> IO (RDF AdjHashMap)+loadGraph file =+ parseFile (TurtleParser Nothing Nothing) file >>= \result -> case result of+ Left err -> error $ show err+ Right rdfGraph -> return rdfGraph++vocabulary :: Rdf a => RDF a -> [Dec]+vocabulary graph =+ let nameDecls = do+ subject <- nub $ subjectOf <$> triplesOf graph+ iri <- maybeToList $ toIRI subject+ name <- maybeToList $ iriToName iri+ return (name, declareIRI name iri)+ (PrefixMappings prefixMappings') = prefixMappings graph+ namespaceDecls = do+ (prefix, iri) <- M.toList prefixMappings'+ let name = mkName . T.unpack . escape $ prefix <> "NS"+ return $ declarePrefix name prefix iri+ iriDecls = snd <$> nameDecls+ irisDecl = declareIRIs $ fst <$> nameDecls+ in irisDecl : namespaceDecls <> iriDecls++toIRI :: Node -> Maybe Text+toIRI (UNode iri) = Just iri+toIRI _ = Nothing++packFun :: Exp+packFun = VarE $ mkName "Data.Text.pack"++unodeFun :: Exp+unodeFun = VarE $ mkName "Data.RDF.Types.unode"++mkPrefixedNSFun :: Exp+mkPrefixedNSFun = VarE $ mkName "Data.RDF.Namespace.mkPrefixedNS"++declareIRI :: Name -> Text -> Dec+declareIRI name iri =+ let iriLiteral = LitE . StringL $ T.unpack iri+ unodeLiteral = AppE unodeFun $ AppE packFun iriLiteral+ in FunD name [Clause [] (NormalB unodeLiteral) []]++declareIRIs :: [Name] -> Dec+declareIRIs names =+ let iriList = ListE (VarE <$> names)+ in FunD (mkName "iris") [Clause [] (NormalB iriList) []]++-- namespace = mkPrefixedNS "ogit" "http://www.purl.org/ogit/"+declarePrefix :: Name -> Text -> Text -> Dec+declarePrefix name prefix iri =+ let prefixLiteral = AppE packFun . LitE . StringL . T.unpack $ prefix+ iriLiteral = AppE packFun . LitE . StringL . T.unpack $ iri+ namespace = AppE (AppE mkPrefixedNSFun prefixLiteral) iriLiteral+ in FunD name [Clause [] (NormalB namespace) []]++iriToName :: Text -> Maybe Name+iriToName iri = mkName . T.unpack . escape <$> (lastMay . filter (not . T.null) . T.split (`elem` separators)) iri+ where+ separators = ['/', '#']+ lastMay :: [a] -> Maybe a+ lastMay [] = Nothing+ lastMay xs = Just (last xs)++escape :: Text -> Text+escape name = escapeKeywords $ T.map escapeOperators name+ where+ escapeOperators c | c `elem` operators = escapeChar+ escapeOperators c = c+ escapeKeywords name' | not (isLower $ T.head name') = escapeChar `T.cons` name'+ escapeKeywords name' | name' `elem` keywords = escapeChar `T.cons` name'+ escapeKeywords name' = name'+ operators = ['!', '#', '$', '%', '&', '*', '+', '.', '/', '<', '=', '>', '?', '@', '\\', '^', '|', '-', '~']+ keywords =+ [ "as",+ "case",+ "of",+ "class",+ "data",+ "data family",+ "data instance",+ "default",+ "deriving",+ "deriving instance",+ "do",+ "forall",+ "foreign",+ "hiding",+ "if",+ "then",+ "else",+ "import",+ "infix",+ "infixl",+ "infixr",+ "instance",+ "let",+ "in",+ "mdo",+ "module",+ "newtype",+ "proc",+ "qualified",+ "rec",+ "type",+ "type family",+ "type instance",+ "where"+ ]+ escapeChar = '_'
+ src/Data/RDF/Vocabulary/OWL.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.OWL where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/owl.ttl")
+ src/Data/RDF/Vocabulary/RDF.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.RDF where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/rdf.ttl")
+ src/Data/RDF/Vocabulary/RDFS.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.RDFS where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/rdfs.ttl")
+ src/Data/RDF/Vocabulary/SHACL.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.SHACL where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/shacl.ttl")
+ src/Data/RDF/Vocabulary/SKOS.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.SKOS where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/skos.ttl")
+ src/Data/RDF/Vocabulary/VANN.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.VANN where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/vann.ttl")
+ src/Data/RDF/Vocabulary/XSD.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -Wno-missing-signatures #-}++module Data.RDF.Vocabulary.XSD where++import qualified Data.RDF.Namespace (mkPrefixedNS)+import qualified Data.RDF.Types (unode)+import Data.RDF.Vocabulary.Generator.VocabularyGenerator (genVocabulary)+import qualified Data.Text (pack)++$(genVocabulary "resources/xsd.ttl")
src/Text/RDF/RDF4H/NTriplesParser.hs view
@@ -1,19 +1,22 @@ {-# LANGUAGE CPP #-} --- |A parser for RDF in N-Triples format--- <http://www.w3.org/TR/rdf-testcases/#ntriples>.-+-- | A parser for RDF in N-Triples format+-- <http://www.w3.org/TR/rdf-testcases/#ntriples>. module Text.RDF.RDF4H.NTriplesParser- ( NTriplesParser(NTriplesParser)- , NTriplesParserCustom(NTriplesParserCustom)- , ParseFailure- , nt_echar, nt_uchar, nt_langtag- , string_literal_quote, nt_string_literal_quote- , nt_pn_chars_base, nt_comment- , readFile- ) where+ ( NTriplesParser (NTriplesParser),+ NTriplesParserCustom (NTriplesParserCustom),+ ParseFailure,+ nt_echar,+ nt_uchar,+ nt_langtag,+ string_literal_quote,+ nt_string_literal_quote,+ nt_pn_chars_base,+ nt_comment,+ readFile,+ )+where -import Prelude hiding (readFile) #if MIN_VERSION_base(4,9,0) #if !MIN_VERSION_base(4,11,0) import Data.Semigroup ((<>))@@ -21,58 +24,58 @@ #endif #else #endif-import Data.Char (isDigit, isLetter, isAlphaNum, isAsciiUpper, isAsciiLower)+ import Control.Applicative import Control.Monad (void)--import Data.RDF.Types hiding (empty)+import Data.Attoparsec.ByteString (IResult (..), parse)+import Data.Char (isAlphaNum, isAsciiLower, isAsciiUpper, isDigit, isLetter) import Data.RDF.IRI-import Text.RDF.RDF4H.ParserUtils--import Data.Attoparsec.ByteString (parse, IResult(..))-import Text.Parsec (runParser, ParseError)-import Text.Parser.LookAhead-import Text.Parser.Char-import Text.Parser.Combinators+import Data.RDF.Types hiding (empty) import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Text.IO as T-import System.IO (IOMode(..), withFile, hSetNewlineMode, noNewlineTranslation, hSetEncoding, utf8)-+import System.IO (IOMode (..), hSetEncoding, hSetNewlineMode, noNewlineTranslation, utf8, withFile)+import Text.Parsec (ParseError, runParser)+import Text.Parser.Char+import Text.Parser.Combinators+import Text.Parser.LookAhead+import Text.RDF.RDF4H.ParserUtils+import Prelude hiding (readFile) --- |NTriplesParser is an 'RdfParser' implementation for parsing RDF in the--- NTriples format. It requires no configuration options. To use this parser,--- pass an 'NTriplesParser' value as the first argument to any of the--- 'parseString', 'parseFile', or 'parseURL' methods of the 'RdfParser' type--- class.+-- | NTriplesParser is an 'RdfParser' implementation for parsing RDF in the+-- NTriples format. It requires no configuration options. To use this parser,+-- pass an 'NTriplesParser' value as the first argument to any of the+-- 'parseString', 'parseFile', or 'parseURL' methods of the 'RdfParser' type+-- class. data NTriplesParser = NTriplesParser newtype NTriplesParserCustom = NTriplesParserCustom Parser --- |'NTriplesParser' is an instance of 'RdfParser' using parsec based parsers.+-- | 'NTriplesParser' is an instance of 'RdfParser' using parsec based parsers. instance RdfParser NTriplesParser where- parseString _ = parseStringParsec- parseFile _ = parseFileParsec- parseURL _ = parseURLParsec+ parseString _ = parseStringParsec+ parseFile _ = parseFileParsec+ parseURL _ = parseURLParsec --- |'NTriplesParser' is an instance of 'RdfParser'.+-- | 'NTriplesParser' is an instance of 'RdfParser'. instance RdfParser NTriplesParserCustom where- parseString (NTriplesParserCustom Parsec) = parseStringParsec+ parseString (NTriplesParserCustom Parsec) = parseStringParsec parseString (NTriplesParserCustom Attoparsec) = parseStringAttoparsec- parseFile (NTriplesParserCustom Parsec) = parseFileParsec- parseFile (NTriplesParserCustom Attoparsec) = parseFileAttoparsec- parseURL (NTriplesParserCustom Parsec) = parseURLParsec- parseURL (NTriplesParserCustom Attoparsec) = parseURLAttoparsec+ parseFile (NTriplesParserCustom Parsec) = parseFileParsec+ parseFile (NTriplesParserCustom Attoparsec) = parseFileAttoparsec+ parseURL (NTriplesParserCustom Parsec) = parseURLParsec+ parseURL (NTriplesParserCustom Attoparsec) = parseURLAttoparsec -- We define or redefine all here using same names as the spec, but with an -- 'nt_' prefix in order to avoid name clashes (e.g., ntripleDoc becomes -- nt_ntripleDoc). --- |nt_ntripleDoc is simply zero or more lines.--- grammar [1] ntriplesDoc ::= triple? (EOL triple)* EOL?+-- | nt_ntripleDoc is simply zero or more lines.+-- grammar [1] ntriplesDoc ::= triple? (EOL triple)* EOL? nt_ntripleDoc :: (CharParsing m, LookAheadParsing m, Monad m) => m [Triple] nt_ntripleDoc = many sep *> sepEndBy (try nt_triple) (many sep) <* eof- where sep = many nt_space *> (try nt_comment <|> try nt_eoln) *> many nt_space+ where+ sep = many nt_space *> (try nt_comment <|> try nt_eoln) *> many nt_space -- A triple consists of whitespace-delimited subject, predicate, and object, -- followed by optional whitespace and a period, and possibly more@@ -87,10 +90,11 @@ -- a space or tab character between resources or the object and the '.'. -- Grammar [2] triple ::= subject predicate object '.' nt_triple :: (CharParsing m, LookAheadParsing m, Monad m) => m Triple-nt_triple = Triple- <$> (nt_subject <* optional (skipSome nt_space))- <*> (nt_predicate <* optional (skipSome nt_space))- <*> (nt_object <* optional (skipSome nt_space) <* char '.' <* many nt_space)+nt_triple =+ Triple+ <$> (nt_subject <* optional (skipSome nt_space))+ <*> (nt_predicate <* optional (skipSome nt_space))+ <*> (nt_object <* optional (skipSome nt_space) <* char '.' <* many nt_space) -- Grammar [6] literal ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG)? nt_literal :: (CharParsing m, Monad m) => m LValue@@ -107,16 +111,18 @@ string_literal_quote :: (CharParsing m, Monad m) => Char -> m T.Text string_literal_quote d = between (char d) (char d) string_literal- where string_literal = T.pack <$> many (try validLiteralChar)- validLiteralChar = noneOf [d,'\x5C','\xA','\xD']- <|> nt_echar- <|> nt_uchar+ where+ string_literal = T.pack <$> many (try validLiteralChar)+ validLiteralChar =+ noneOf [d, '\x5C', '\xA', '\xD']+ <|> nt_echar+ <|> nt_uchar -- Grammar [144s] LANGTAG ::= '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)* nt_langtag :: (CharParsing m, Monad m) => m T.Text nt_langtag = do- ss <- char '@' *> some (satisfy isLetter)- rest <- concat <$> many (char '-' *> some (satisfy isAlphaNum) >>= \lang_str -> pure ('-':lang_str))+ ss <- char '@' *> some (satisfy isLetter)+ rest <- concat <$> many (char '-' *> some (satisfy isAlphaNum) >>= \lang_str -> pure ('-' : lang_str)) pure (T.pack (ss <> rest)) -- [8] IRIREF@@ -130,15 +136,15 @@ nt_echar = try $ do c2 <- char '\\' *> anyChar case c2 of- 't' -> pure '\t'- 'b' -> pure '\b'- 'n' -> pure '\n'- 'r' -> pure '\r'- 'f' -> pure '\f'- '"' -> pure '\"'+ 't' -> pure '\t'+ 'b' -> pure '\b'+ 'n' -> pure '\n'+ 'r' -> pure '\r'+ 'f' -> pure '\f'+ '"' -> pure '\"' '\'' -> pure '\'' '\\' -> pure '\\'- _ -> empty+ _ -> empty -- [10] UCHAR ::= '\u' HEX HEX HEX HEX | '\U' HEX HEX HEX HEX HEX HEX HEX HEX nt_uchar :: (CharParsing m, Monad m) => m Char@@ -147,8 +153,9 @@ -- A subject is either a URI reference for a resource or a node id for a -- blank node. nt_subject :: (CharParsing m, LookAheadParsing m, Monad m) => m Node-nt_subject = unode <$> try nt_iriref- <|> bnode <$> nt_blank_node_label+nt_subject =+ unode <$> try nt_iriref+ <|> bnodeUnsafe <$> nt_blank_node_label -- A predicate may only be a URI reference to a resource. nt_predicate :: (CharParsing m, Monad m) => m Node@@ -157,36 +164,41 @@ -- An object may be either a resource (represented by a URI reference), -- a blank node (represented by a node id), or an object literal. nt_object :: (CharParsing m, LookAheadParsing m, Monad m) => m Node-nt_object = unode <$> try nt_iriref- <|> bnode <$> try nt_blank_node_label- <|> LNode <$> nt_literal+nt_object =+ unode <$> try nt_iriref+ <|> bnodeUnsafe <$> try nt_blank_node_label+ <|> LNode <$> nt_literal -- [141s] BLANK_NODE_LABEL ::= '_:' (PN_CHARS_U | [0-9]) ((PN_CHARS | '.')* PN_CHARS)? nt_blank_node_label :: (CharParsing m, LookAheadParsing m, Monad m) => m T.Text nt_blank_node_label = do void (string "_:") firstChar <- nt_pn_chars_u <|> satisfy isDigit- otherChars <- option "" $ try $- many (nt_pn_chars <|> try (char '.' <* lookAhead (try nt_pn_chars)))+ otherChars <-+ option "" $+ try $+ many (nt_pn_chars <|> try (char '.' <* lookAhead (try nt_pn_chars))) pure $ T.pack (firstChar : otherChars) -- [157s] PN_CHARS_BASE ::= [A-Z] | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] nt_pn_chars_base :: CharParsing m => m Char nt_pn_chars_base = try $ satisfy isBaseChar- where isBaseChar c = (isAsciiUpper c)- || (isAsciiLower c)- || (c >= '\x00C0' && c <= '\x00D6')- || (c >= '\x00D8' && c <= '\x00F6')- || (c >= '\x00F8' && c <= '\x02FF')- || (c >= '\x0370' && c <= '\x037D')- || (c >= '\x037F' && c <= '\x1FFF')- || (c >= '\x200C' && c <= '\x200D')- || (c >= '\x2070' && c <= '\x218F')- || (c >= '\x2C00' && c <= '\x2FEF')- || (c >= '\x3001' && c <= '\xD7FF')- || (c >= '\xF900' && c <= '\xFDCF')- || (c >= '\xFDF0' && c <= '\xFFFD')- || (c >= '\x10000' && c <= '\xEFFFF')+ where+ isBaseChar c =+ (isAsciiUpper c)+ || (isAsciiLower c)+ || (c >= '\x00C0' && c <= '\x00D6')+ || (c >= '\x00D8' && c <= '\x00F6')+ || (c >= '\x00F8' && c <= '\x02FF')+ || (c >= '\x0370' && c <= '\x037D')+ || (c >= '\x037F' && c <= '\x1FFF')+ || (c >= '\x200C' && c <= '\x200D')+ || (c >= '\x2070' && c <= '\x218F')+ || (c >= '\x2C00' && c <= '\x2FEF')+ || (c >= '\x3001' && c <= '\xD7FF')+ || (c >= '\xF900' && c <= '\xFDCF')+ || (c >= '\xFDF0' && c <= '\xFFFD')+ || (c >= '\x10000' && c <= '\xEFFFF') -- [158s] PN_CHARS_U nt_pn_chars_u :: CharParsing m => m Char@@ -194,18 +206,21 @@ -- [160s] PN_CHARS nt_pn_chars :: CharParsing m => m Char-nt_pn_chars = nt_pn_chars_u- <|> try (char '-')- <|> try (char '\x00B7')- <|> try (satisfy f)- where f c = isDigit c- || (c >= '\x0300' && c <= '\x036F')- || (c >= '\x203F' && c <= '\x2040')+nt_pn_chars =+ nt_pn_chars_u+ <|> try (char '-')+ <|> try (char '\x00B7')+ <|> try (satisfy f)+ where+ f c =+ isDigit c+ || (c >= '\x0300' && c <= '\x036F')+ || (c >= '\x203F' && c <= '\x2040') -- End-of-line consists of either lf or crlf. -- We also test for eof and consider that to match as well. nt_eoln :: CharParsing m => m ()-nt_eoln = try (void (string "\r\n")) <|> void (char '\n')+nt_eoln = try (void (string "\r\n")) <|> void (char '\n') -- Whitespace is either a space or a tabulation. -- The built-in space combinator must be avoided here, because it includes newline.@@ -224,7 +239,7 @@ parseFileParsec :: (Rdf a) => String -> IO (Either ParseFailure (RDF a)) parseFileParsec path = handleParsec mkRdf . runParser nt_ntripleDoc () path- <$> readFile path+ <$> readFile path readFile :: FilePath -> IO T.Text readFile fpath = withFile fpath ReadMode $ \h -> do@@ -235,10 +250,12 @@ parseURLParsec :: (Rdf a) => String -> IO (Either ParseFailure (RDF a)) parseURLParsec = parseFromURL parseStringParsec -handleParsec :: (Triples -> Maybe BaseUrl -> PrefixMappings -> RDF a) ->- Either ParseError [Triple] -> Either ParseFailure (RDF a)+handleParsec ::+ (Triples -> Maybe BaseUrl -> PrefixMappings -> RDF a) ->+ Either ParseError [Triple] ->+ Either ParseFailure (RDF a) handleParsec _mkRdf result = case result of- Left err -> Left $ ParseFailure $ "Parse failure: \n" <> show err+ Left err -> Left $ ParseFailure $ "Parse failure: \n" <> show err Right ts -> Right $ _mkRdf ts Nothing (PrefixMappings mempty) ---------------------------------@@ -259,12 +276,12 @@ handleAttoparsec bs = handleResult $ parse nt_ntripleDoc (T.encodeUtf8 bs) where handleResult res = case res of- Fail _i _contexts err -> Left $ ParseFailure $ "Parse failure: \n" <> show err- -- error $- -- "\nnot consumed: " <> show i- -- <> "\ncontexts: " <> show contexts- -- <> "\nerror: " <> show err- Partial f -> handleResult (f (T.encodeUtf8 mempty))- Done _ ts -> Right $ mkRdf ts Nothing (PrefixMappings mempty)+ Fail _i _contexts err -> Left $ ParseFailure $ "Parse failure: \n" <> show err+ -- error $+ -- "\nnot consumed: " <> show i+ -- <> "\ncontexts: " <> show contexts+ -- <> "\nerror: " <> show err+ Partial f -> handleResult (f (T.encodeUtf8 mempty))+ Done _ ts -> Right $ mkRdf ts Nothing (PrefixMappings mempty) ---------------------------------
src/Text/RDF/RDF4H/TurtleSerializer.hs view
@@ -3,8 +3,7 @@ -- | An RDF serializer for Turtle -- <http://www.w3.org/TeamSubmission/turtle/>. module Text.RDF.RDF4H.TurtleSerializer- ( TurtleSerializer (TurtleSerializer),- )+ (TurtleSerializer (TurtleSerializer)) where #if MIN_VERSION_base(4,9,0)@@ -16,8 +15,7 @@ #endif import Control.Monad-import Data.List-import Data.Map (Map)+import Data.List (groupBy, sort) import qualified Data.Map as Map import Data.RDF.Namespace hiding (rdf) import Data.RDF.Query@@ -25,6 +23,7 @@ import qualified Data.Text as T import qualified Data.Text.IO as T import System.IO+import Text.RDF.RDF4H.TurtleSerializer.Internal data TurtleSerializer = TurtleSerializer (Maybe T.Text) PrefixMappings @@ -39,7 +38,7 @@ writeTs s = hWriteTs s stdout hWriteT (TurtleSerializer docUrl pms) h = writeTriple h docUrl pms writeT s = hWriteT s stdout- hWriteN (TurtleSerializer docUrl (PrefixMappings pms)) h n = writeNode h docUrl n pms+ hWriteN (TurtleSerializer docUrl pms) h n = writeNode h docUrl n pms writeN s = hWriteN s stdout -- TODO: writeRdf currently merges standard namespace prefix mappings with@@ -82,12 +81,12 @@ writeTriples :: Handle -> Maybe T.Text -> PrefixMappings -> Triples -> IO () writeTriples h mdUrl (PrefixMappings pms) ts =- mapM_ (writeSubjGroup h mdUrl revPms) (groupBy equalSubjects ts)+ mapM_ (writeSubjGroup h mdUrl revPms) (groupBy equalSubjects (sort ts)) where- revPms = Map.fromList $ (\(k, v) -> (v, k)) <$> Map.toList pms+ revPms = PrefixMappings . Map.fromList $ (\(k, v) -> (v, k)) <$> Map.toList pms writeTriple :: Handle -> Maybe T.Text -> PrefixMappings -> Triple -> IO ()-writeTriple h mdUrl (PrefixMappings pms) t =+writeTriple h mdUrl pms t = w subjectOf >> space >> w predicateOf >> space >> w objectOf where w :: (Triple -> Node) -> IO ()@@ -96,7 +95,7 @@ -- Write a group of triples that all have the same subject, with the subject only -- being output once, and comma or semi-colon used as appropriate.-writeSubjGroup :: Handle -> Maybe T.Text -> Map T.Text T.Text -> Triples -> IO ()+writeSubjGroup :: Handle -> Maybe T.Text -> PrefixMappings -> Triples -> IO () writeSubjGroup _ _ _ [] = return () writeSubjGroup h dUrl pms ts@(t : _) = writeNode h dUrl (subjectOf t) pms >> hPutChar h ' '@@ -109,7 +108,7 @@ -- Write a group of triples that all have the same subject and the same predicate, -- assuming the subject has already been output and only the predicate and objects -- need to be written.-writePredGroup :: Handle -> Maybe T.Text -> Map T.Text T.Text -> Triples -> IO ()+writePredGroup :: Handle -> Maybe T.Text -> PrefixMappings -> Triples -> IO () writePredGroup _ _ _ [] = return () writePredGroup h docUrl pms (t : ts) = -- The doesn't rule out <> in either the predicate or object (as well as subject),@@ -118,43 +117,23 @@ >> writeNode h docUrl (objectOf t) pms >> mapM_ (\t' -> hPutStr h ", " >> writeNode h docUrl (objectOf t') pms) ts -writeNode :: Handle -> Maybe T.Text -> Node -> Map T.Text T.Text -> IO ()-writeNode h mdUrl node prefixes =+writeNode :: Handle -> Maybe T.Text -> Node -> PrefixMappings -> IO ()+writeNode h mdUrl node pms = case node of (UNode bs) -> let currUri = bs in case mdUrl of- Nothing -> writeUNodeUri h currUri prefixes- Just url -> if url == currUri then hPutStr h "<>" else writeUNodeUri h currUri prefixes+ Nothing -> writeUNodeUri h currUri pms+ Just url -> if url == currUri then hPutStr h "<>" else writeUNodeUri h currUri pms (BNode gId) -> T.hPutStr h gId (BNodeGen i) -> putStr "_:genid" >> hPutStr h (show i)- (LNode n) -> writeLValue h n prefixes--writeUNodeUri :: Handle -> T.Text -> Map T.Text T.Text -> IO ()-writeUNodeUri h uri prefixes =- case mapping of- Nothing -> hPutChar h '<' >> T.hPutStr h uri >> hPutChar h '>'- (Just (pre, localName)) -> T.hPutStr h pre >> hPutChar h ':' >> T.hPutStr h localName- where- mapping = findMapping prefixes uri+ (LNode n) -> writeLValue h n pms -- Print prefix mappings to stdout for debugging.-_debugPMs :: Map T.Text T.Text -> IO ()-_debugPMs pms = mapM_ (\(k, v) -> T.putStr k >> putStr "__" >> T.putStrLn v) (Map.toList pms)---- Expects a map from uri to prefix, and returns the (prefix, uri_expansion)--- from the mappings such that uri_expansion is a prefix of uri, or Nothing if--- there is no such mapping. This function does a linear-time search over the--- map, but the prefix mappings should always be very small, so it's okay for now.-findMapping :: Map T.Text T.Text -> T.Text -> Maybe (T.Text, T.Text)-findMapping pms uri =- case mapping of- Nothing -> Nothing- Just (u, p) -> Just (p, T.drop (T.length u) uri) -- empty localName is permitted- where- mapping = find (\(k, _) -> T.isPrefixOf k uri) (Map.toList pms)+_debugPMs :: PrefixMappings -> IO ()+_debugPMs (PrefixMappings pms) = mapM_ (\(k, v) -> T.putStr k >> putStr "__" >> T.putStrLn v) (Map.toList pms) -writeLValue :: Handle -> LValue -> Map T.Text T.Text -> IO ()+writeLValue :: Handle -> LValue -> PrefixMappings -> IO () writeLValue h lv pms = case lv of (PlainL lit) -> writeLiteralString h lit
+ src/Text/RDF/RDF4H/TurtleSerializer/Internal.hs view
@@ -0,0 +1,56 @@+{-# LANGUAGE OverloadedStrings #-}++module Text.RDF.RDF4H.TurtleSerializer.Internal+ ( findMapping+ , writeUNodeUri+ )+where++import Data.Foldable (fold)+import Data.List (elemIndex)+import qualified Data.Map as Map+import Data.Monoid (Any(..), getAny)+import Data.RDF.Namespace hiding (rdf)+import qualified Data.Text as T+import qualified Data.Text.IO as T+import System.IO++-- |Converts an aliased URI (e.g., 'rdf:subject') to a tuple whose first element+-- is the full (non-aliased) URI and whose second element is the target/path+-- portion (the part after the colon in the aliased URI).+findMapping :: PrefixMappings -- ^The 'PrefixMappings' to be searched for the prefix that may be a part of the URI.+ -> T.Text -- ^The URI.+ -> Maybe (T.Text, T.Text)+findMapping (PrefixMappings pms) aliasedURI = do+ (prefix, target) <- splitAliasedURI aliasedURI+ uri <- Map.lookup prefix pms+ pure (uri, target)++-- |Writes the given 'UNode' to the given 'Handle'.+writeUNodeUri :: Handle -- ^The Handle to write to+ -> T.Text -- ^The text from a UNode+ -> PrefixMappings -- ^The 'PrefixMappings' which should contain a mapping for any prefix found in the URI.+ -> IO ()+writeUNodeUri h uri _ =+ if (isQName uri)+ then T.hPutStr h uri+ else hPutChar h '<' >> T.hPutStr h uri >> hPutChar h '>'++isQName :: T.Text -> Bool+isQName = not . isFullURI+ where isFullURI :: T.Text -> Bool+ isFullURI = getAny . foldMap (Any .) [ ("http://" `T.isPrefixOf`)+ , ("https://" `T.isPrefixOf`)+ , ("file://" `T.isPrefixOf`)+ ]++-- |Given an aliased URI (e.g., 'rdf:subject') return a tuple whose first+-- element is the alias ('rdf') and whose second part is the path or fragment+-- ('subject').+splitAliasedURI :: T.Text -- ^Aliased URI.+ -> Maybe (T.Text, T.Text)+splitAliasedURI uri = do+ let uriStr = T.unpack uri+ i <- elemIndex ':' uriStr+ let (prefix, target) = splitAt i uriStr+ pure (T.pack prefix, T.pack $ tail target)
src/Text/RDF/RDF4H/XmlParser.hs view
@@ -1,24 +1,33 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE DoAndIfThenElse #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE OverloadedLists #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE OverloadedLists #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE DoAndIfThenElse #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE LambdaCase #-} --- | An parser for the RDF/XML format--- <http://www.w3.org/TR/REC-rdf-syntax/>.+-- |An parser for the RDF/XML format+-- <http://www.w3.org/TR/REC-rdf-syntax/>.+ module Text.RDF.RDF4H.XmlParser- ( XmlParser (..),- parseXmlDebug,- )-where+ ( XmlParser(..)+ , parseXmlDebug+ ) where -import Control.Applicative-import Control.Monad-import Control.Monad.Except-import Control.Monad.State.Strict+import Data.RDF.Types hiding (empty, resolveQName)+import qualified Data.RDF.Types as RDF+import Data.RDF.IRI+import Data.RDF.Graph.TList+import Text.RDF.RDF4H.ParserUtils hiding (Parser)+import Text.RDF.RDF4H.XmlParser.Identifiers+import Text.RDF.RDF4H.XmlParser.Xmlbf hiding (Node)+import qualified Text.RDF.RDF4H.XmlParser.Xeno as Xeno++import Control.Applicative+import Control.Monad+import Control.Monad.Except+import Control.Monad.State.Strict #if MIN_VERSION_base(4,9,0) #if !MIN_VERSION_base(4,11,0) import Data.Semigroup@@ -26,107 +35,90 @@ #endif #else #endif-+import Data.Set (Set)+import qualified Data.Set as S+import qualified Data.Map as Map+import Data.Maybe #if MIN_VERSION_base(4,10,0) import Data.Either #else #endif-import Data.Bifunctor-import qualified Data.ByteString.Builder as BB-import qualified Data.ByteString.Lazy as BL-import Data.HashMap.Strict (HashMap)-import qualified Data.HashMap.Strict as HM-import Data.HashSet (HashSet)+import Data.Bifunctor+import Data.HashSet (HashSet) import qualified Data.HashSet as HS-import qualified Data.Map as Map-import Data.Maybe-import Data.RDF.Graph.TList-import Data.RDF.IRI-import Data.RDF.Types hiding (empty, resolveQName)-import qualified Data.RDF.Types as RDF-import Data.Set (Set)-import qualified Data.Set as S-import Data.Text (Text)+import Data.HashMap.Strict (HashMap)+import qualified Data.HashMap.Strict as HM+import Data.Text (Text) import qualified Data.Text as T-import qualified Data.Text.Encoding as T import qualified Data.Text.IO as TIO import qualified Data.Text.Lazy as TL-import Text.RDF.RDF4H.ParserUtils hiding (Parser)-import Text.RDF.RDF4H.XmlParser.Identifiers-import qualified Text.RDF.RDF4H.XmlParser.Xeno as Xeno-import Text.RDF.RDF4H.XmlParser.Xmlbf hiding (Node)-+import qualified Data.Text.Encoding as T+import qualified Data.ByteString.Lazy as BL+import qualified Data.ByteString.Builder as BB -- import Xmlbf hiding (Node, State) -- import qualified Xmlbf.Xeno as Xeno instance RdfParser XmlParser where parseString (XmlParser bUrl dUrl) = parseXmlRDF bUrl dUrl- parseFile (XmlParser bUrl dUrl) = parseFile' bUrl dUrl- parseURL (XmlParser bUrl dUrl) = parseURL' bUrl dUrl+ parseFile (XmlParser bUrl dUrl) = parseFile' bUrl dUrl+ parseURL (XmlParser bUrl dUrl) = parseURL' bUrl dUrl --- | Configuration for the XML parser-data XmlParser- = XmlParser- (Maybe BaseUrl)- -- ^ The /default/ base URI to parse the document.- (Maybe Text)- -- ^ The /retrieval URI/ of the XML document.+-- |Configuration for the XML parser+data XmlParser =+ XmlParser (Maybe BaseUrl) -- ^ The /default/ base URI to parse the document.+ (Maybe Text) -- ^ The /retrieval URI/ of the XML document. -parseFile' ::- (Rdf a) =>- Maybe BaseUrl ->- Maybe Text ->- FilePath ->- IO (Either ParseFailure (RDF a))+parseFile' :: (Rdf a)+ => Maybe BaseUrl+ -> Maybe Text+ -> FilePath+ -> IO (Either ParseFailure (RDF a)) parseFile' bUrl dUrl fpath = parseXmlRDF bUrl dUrl <$> TIO.readFile fpath -parseURL' ::- (Rdf a) =>- -- | The optional base URI of the document.- Maybe BaseUrl ->- -- | The document URI (i.e., the URI of the document itself); if Nothing, use location URI.- Maybe Text ->- -- | The location URI from which to retrieve the XML document.- String ->- -- | The parse result, which is either a @ParseFailure@ or the RDF+parseURL' :: (Rdf a)+ => Maybe BaseUrl+ -- ^ The optional base URI of the document.+ -> Maybe Text+ -- ^ The document URI (i.e., the URI of the document itself); if Nothing, use location URI.+ -> String+ -- ^ The location URI from which to retrieve the XML document.+ -> IO (Either ParseFailure (RDF a))+ -- ^ The parse result, which is either a @ParseFailure@ or the RDF -- corresponding to the XML document.- IO (Either ParseFailure (RDF a)) parseURL' bUrl docUrl = parseFromURL (parseXmlRDF bUrl docUrl) --- | The parser monad.+-- |The parser monad. type Parser = ParserT (ExceptT String (State ParseState)) --- | Local state for the parser (dependant on the parent xml elements)+-- |Local state for the parser (dependant on the parent xml elements) data ParseState = ParseState- { -- | The local base URI.- stateBaseUri :: Maybe BaseUrl,- -- | The set of @rdf:ID@ found in the scope of the current base URI.- stateIdSet :: Set Text,- -- | The namespace mapping.- statePrefixMapping :: PrefixMappings,- -- | The local @xml:lang@- stateLang :: Maybe Text,- -- | Current node RDF attributes.- stateNodeAttrs :: HashMap Text Text,- -- | Current subject for triple construction.- stateSubject :: Maybe Subject,- -- | Current collection index.- stateCollectionIndex :: Int,- stateGenId :: Int- }- deriving (Show)+ { stateBaseUri :: Maybe BaseUrl+ -- ^ The local base URI.+ , stateIdSet :: Set Text+ -- ^ The set of @rdf:ID@ found in the scope of the current base URI.+ , statePrefixMapping :: PrefixMappings+ -- ^ The namespace mapping.+ , stateLang :: Maybe Text+ -- ^ The local @xml:lang@+ , stateNodeAttrs :: HashMap Text Text+ -- ^ Current node RDF attributes.+ , stateSubject :: Maybe Subject+ -- ^ Current subject for triple construction.+ , stateCollectionIndex :: Int+ -- ^ Current collection index.+ , stateGenId :: Int+ } deriving(Show) --- | Parse a xml Text to an RDF representation-parseXmlRDF ::- (Rdf a) =>- -- | The base URI for the RDF if required- Maybe BaseUrl ->- -- | The request URI for the document to if available- Maybe Text ->- -- | The contents to parse- Text ->- -- | The RDF representation of the triples or ParseFailure- Either ParseFailure (RDF a)+-- |Parse a xml Text to an RDF representation+parseXmlRDF :: (Rdf a)+ => Maybe BaseUrl+ -- ^ The base URI for the RDF if required+ -> Maybe Text+ -- ^ The request URI for the document to if available+ -> Text+ -- ^ The contents to parse+ -> Either ParseFailure (RDF a)+ -- ^ The RDF representation of the triples or ParseFailure parseXmlRDF bUrl dUrl = parseRdf . parseXml where bUrl' = BaseUrl <$> dUrl <|> bUrl@@ -135,14 +127,14 @@ parseRdf' ns = join $ evalState (runExceptT (parseM rdfParser ns)) initState initState = ParseState bUrl' mempty mempty empty mempty empty 0 0 --- | A parser for debugging purposes.-parseXmlDebug ::- -- | Path of the file to parse.- FilePath ->- IO (RDF TList)+-- |A parser for debugging purposes.+parseXmlDebug+ :: FilePath+ -- ^ Path of the file to parse.+ -> IO (RDF TList) parseXmlDebug f = fromRight RDF.empty <$> parseFile (XmlParser (Just . BaseUrl $ "http://base-url.com/") (Just "http://doc-url.com/")) f --- | Document parser+-- |Document parser rdfParser :: Rdf a => Parser (RDF a) rdfParser = do bUri <- currentBaseUri@@ -150,8 +142,8 @@ pEndOfInput mkRdf triples bUri <$> currentPrefixMappings --- | Parser for @rdf:RDF@, if present.--- See: https://www.w3.org/TR/rdf-syntax-grammar/#RDF+-- |Parser for @rdf:RDF@, if present.+-- See: https://www.w3.org/TR/rdf-syntax-grammar/#RDF pRdf :: Parser Triples pRdf = pAnyElement $ do attrs <- pRDFAttrs@@ -160,18 +152,18 @@ unless (null attrs) $ throwError "rdf:RDF: The set of attributes should be empty." pNodeElementList --- | Parser for XML QName: resolve the namespace with the mapping in context.+-- |Parser for XML QName: resolve the namespace with the mapping in context. ----- Throws an error if the namespace is not defined.+-- Throws an error if the namespace is not defined. pQName :: Text -> Parser Text pQName qn = do pm <- currentPrefixMappings let qn' = resolveQName pm qn >>= validateIRI either throwError pure qn' --- | Process the attributes of an XML element.+-- |Process the attributes of an XML element. ----- To be called __once__ per XML element.+-- To be called __once__ per XML element. pRDFAttrs :: Parser (HashMap Text Text) pRDFAttrs = do -- Language (xml:lang)@@ -188,49 +180,53 @@ setNodeAttrs as pure as where- mkNameSpace ::- -- | Current namespace mapping- Map.Map Text Text ->- -- | XML attribute to process- Text ->- -- | Value of the attribute- Text ->- Map.Map Text Text+ -- |Check if an XML attribute is a namespace definition+ -- and if so add it to the mapping.+ mkNameSpace+ :: Map.Map Text Text+ -- ^ Current namespace mapping+ -> Text+ -- ^ XML attribute to process+ -> Text+ -- ^ Value of the attribute+ -> Map.Map Text Text mkNameSpace ns qn iri = let qn' = parseQName qn ns' = f <$> qn' <*> validateIRI iri- f (Nothing, "xmlns") iri' = Map.insert mempty iri' ns- f (Just "xmlns", prefix) iri' = Map.insert prefix iri' ns- f _ _ = ns- in either (const ns) id ns'- mkRdfAttribute ::- -- | Namespace mapping- PrefixMappings ->- -- | Base URI- Maybe BaseUrl ->- -- | Current set of RDF attributes- HM.HashMap Text Text ->- -- | XML attribute to process- Text ->- -- | Value of the attribute- Text ->- HM.HashMap Text Text+ f (Nothing , "xmlns") iri' = Map.insert mempty iri' ns+ f (Just "xmlns", prefix ) iri' = Map.insert prefix iri' ns+ f _ _ = ns+ in either (const ns) id ns'+ -- |Check if an XML attribute is an RDF attribute+ -- and if so resolve its URI and keep it.+ mkRdfAttribute+ :: PrefixMappings+ -- ^ Namespace mapping+ -> Maybe BaseUrl+ -- ^ Base URI+ -> HM.HashMap Text Text+ -- ^ Current set of RDF attributes+ -> Text+ -- ^ XML attribute to process+ -> Text+ -- ^ Value of the attribute+ -> HM.HashMap Text Text mkRdfAttribute pm bUri as qn v = let as' = parseQName qn >>= f -- [NOTE] Ignore XML reserved names f (Nothing, n) | T.isPrefixOf "xml" n = Right as- | otherwise = case bUri of- Nothing -> Right as -- [FIXME] manage missing base URI- Just (BaseUrl bUri') -> (\a -> HM.insert a v as) <$> resolveIRI bUri' n+ | otherwise = case bUri of+ Nothing -> Right as -- [FIXME] manage missing base URI+ Just (BaseUrl bUri') -> (\a -> HM.insert a v as) <$> resolveIRI bUri' n f qn'@(Just prefix, _) | T.isPrefixOf "xml" prefix = Right as | otherwise = (\a -> HM.insert a v as) <$> resolveQName' pm qn'- in either (const as) id as'+ in either (const as) id as' --- | Return the value of the requested RDF attribute using its URI.+-- |Return the value of the requested RDF attribute using its URI. ----- Fails if the attribute is not defined.+-- Fails if the attribute is not defined. pRDFAttr :: Text -> Parser Text pRDFAttr a = do as <- currentNodeAttrs@@ -243,8 +239,8 @@ pNodeElementList :: Parser Triples pNodeElementList = pWs *> (mconcat <$> some (keepState pNodeElement <* pWs)) --- | White spaces parser--- See: https://www.w3.org/TR/rdf-syntax-grammar/#ws+-- |White spaces parser+-- See: https://www.w3.org/TR/rdf-syntax-grammar/#ws pWs :: Parser () pWs = maybe True (T.all ws . TL.toStrict) <$> optional pText >>= guard where@@ -263,10 +259,10 @@ ts2 <- keepState pPropertyEltList setSubject (Just s) let ts = ts1 <> ts2- pure $ maybe ts (: ts) mt+ pure $ maybe ts (:ts) mt --- | Process the following parts of a @nodeElement@: URI, subject and @rdf:type@.--- See: https://www.w3.org/TR/rdf-syntax-grammar/#nodeElement+-- |Process the following parts of a @nodeElement@: URI, subject and @rdf:type@.+-- See: https://www.w3.org/TR/rdf-syntax-grammar/#nodeElement pSubject :: Parser (Node, Maybe Triple) pSubject = do -- Create the subject@@ -296,17 +292,15 @@ pPropertyAttrs :: Node -> Parser Triples pPropertyAttrs s = do attrs <- currentNodeAttrs- -- HM.elems <$> HM.traverseWithKey f attrs- HM.elems <$> HM.traverseWithKey f (HM.delete rdfID attrs)+ HM.elems <$> HM.traverseWithKey f attrs where f attr value | not (isPropertyAttrURI attr) = throwError $ "URI not allowed for attribute: " <> T.unpack attr | attr == rdfType = pure $ Triple s rdfTypeNode (unode value) | otherwise = do- lang <- currentLang- pure $- let mkLiteral = maybe plainL (flip plainLL) lang- in Triple s (unode attr) (lnode (mkLiteral value))+ lang <- currentLang+ pure $ let mkLiteral = maybe plainL (flip plainLL) lang+ in Triple s (unode attr) (lnode (mkLiteral value)) pLang :: Parser (Maybe Text) pLang = optional (pAttr "xml:lang")@@ -316,18 +310,16 @@ pBase = optional $ do uri <- pAttr "xml:base" -- Parse and remove fragment- BaseUrl- <$> either- throwError- (pure . serializeIRI . removeIRIFragment)- (parseIRI uri)+ BaseUrl <$> either+ throwError+ (pure . serializeIRI . removeIRIFragment)+ (parseIRI uri) -- See: https://www.w3.org/TR/rdf-syntax-grammar/#propertyEltList pPropertyEltList :: Parser Triples-pPropertyEltList =- pWs- *> resetCollectionIndex- *> fmap mconcat (many (pPropertyElt <* pWs))+pPropertyEltList = pWs+ *> resetCollectionIndex+ *> fmap mconcat (many (pPropertyElt <* pWs)) -- See: https://www.w3.org/TR/rdf-syntax-grammar/#propertyElt pPropertyElt :: Parser Triples@@ -349,7 +341,7 @@ where listExpansion u | u == rdfLi = nextCollectionIndex- | otherwise = pure u+ | otherwise = pure u -- See: https://www.w3.org/TR/rdf-syntax-grammar/#resourcePropertyElt pResourcePropertyElt :: Node -> Parser Triples@@ -366,7 +358,7 @@ let mt = flip Triple p <$> s <*> o -- Reify the triple ts2 <- maybe (pure mempty) (uncurry reifyTriple) (liftA2 (,) mi mt)- pure $ maybe (ts1 <> ts2) (: (ts1 <> ts2)) mt+ pure $ maybe (ts1 <> ts2) (:(ts1 <> ts2)) mt -- See: https://www.w3.org/TR/rdf-syntax-grammar/#literalPropertyElt pLiteralPropertyElt :: Node -> Parser Triples@@ -385,7 +377,7 @@ mt = (\s' -> Triple s' p o) <$> s -- Reify the triple ts <- maybe (pure mempty) (uncurry reifyTriple) (liftA2 (,) mi mt)- pure $ maybe ts (: ts) mt+ pure $ maybe ts (:ts) mt -- See: https://www.w3.org/TR/rdf-syntax-grammar/#parseTypeLiteralPropertyElt pParseTypeLiteralPropertyElt :: Node -> Parser Triples@@ -401,7 +393,7 @@ mt = (\s' -> Triple s' p o) <$> s -- Reify the triple ts <- maybe (pure mempty) (uncurry reifyTriple) (liftA2 (,) mi mt)- pure $ maybe ts (: ts) mt+ pure $ maybe ts (:ts) mt -- See: https://www.w3.org/TR/rdf-syntax-grammar/#parseTypeResourcePropertyElt pParseTypeResourcePropertyElt :: Node -> Parser Triples@@ -420,7 +412,7 @@ -- Explore children ts2 <- keepCollectionIndex pPropertyEltList --setSubject s- pure $ maybe (ts1 <> ts2) ((<> ts2) . (: ts1)) mt+ pure $ maybe (ts1 <> ts2) ((<> ts2) . (:ts1)) mt -- See: https://www.w3.org/TR/rdf-syntax-grammar/#parseTypeCollectionPropertyElt pParseTypeCollectionPropertyElt :: Node -> Parser Triples@@ -438,7 +430,7 @@ Nothing -> -- Empty collection let t = Triple s' p rdfNilNode- in ([t] <>) <$> maybe (pure mempty) (`reifyTriple` t) mi+ in ([t] <>) <$> maybe (pure mempty) (`reifyTriple` t) mi Just ts1 -> do -- Non empty collection s'' <- currentSubject@@ -484,41 +476,22 @@ case s of Nothing -> pure mempty Just s' -> do- -- mi <- optional pIdAttr -- <* removeNodeAttr rdfID- --- notNodeIdAndResource- o <- pResourceAttr' <|> pNodeIdAttr' <|> rdfIdAttr' <|> newBNode+ mi <- optional pIdAttr <* removeNodeAttr rdfID+ o <- pResourceAttr' <|> pNodeIdAttr' <|> newBNode let t = Triple s' p o -- Reify triple- ts1 <- -- maybe (pure mempty) (`reifyTriple` t) mi- do- x <- optional pIdAttr- case x of- Nothing -> mempty- rdfIdSub -> maybe (pure mempty) (`reifyTriple` t) rdfIdSub- -- ts2 <- mempty- --- -- attrs <- currentNodeAttrs- --- ts2 <-- case o of- (LNode _) -> mempty- _ -> pPropertyAttrs o- --- pure (t : ts1 <> ts2)+ ts1 <- maybe (pure mempty) (`reifyTriple` t) mi+ ts2 <- pPropertyAttrs o+ pure (t:ts1 <> ts2) where- -- pure (t : ts1)- pResourceAttr' = unode <$> pResourceAttr <* removeNodeAttr rdfResource pNodeIdAttr' = BNode <$> pNodeIdAttr <* removeNodeAttr rdfNodeID- rdfIdAttr' = pure (lnode (plainL "")) <* (void (pIdAttr <* removeNodeAttr rdfID) <|> noNodeAttrs) checkAllowedAttributes :: HashSet Text -> Parser () checkAllowedAttributes as = do attrs <- currentNodeAttrs let diffAttrs = HS.difference (HM.keysSet attrs) as unless (null diffAttrs) (throwError $ "Attributes not allowed: " <> show diffAttrs)- -- See: https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-xmlliteral, -- https://www.w3.org/TR/rdf-syntax-grammar/#literal pXMLLiteral :: Parser Text@@ -539,16 +512,6 @@ when notUnique (throwError $ "rdf:ID already used in this context: " <> T.unpack i) updateIdSet i --- Cannot have rdf:nodeID and rdf:resource-notNodeIdAndResource :: Parser ()-notNodeIdAndResource = do- attrs <- currentNodeAttrs- guard- ( (HM.member rdfNodeID attrs && not (HM.member rdfResource attrs))- || (not (HM.member rdfNodeID attrs) && (HM.member rdfResource attrs))- || (not (HM.member rdfNodeID attrs) && not (HM.member rdfResource attrs))- )- pNodeIdAttr :: Parser Text pNodeIdAttr = do i <- pRDFAttr rdfNodeID@@ -566,12 +529,10 @@ reifyTriple :: Text -> Triple -> Parser Triples reifyTriple i (Triple s p' o) = do n <- mkUNodeID i- pure- [ Triple n rdfTypeNode rdfStatementNode,- Triple n rdfSubjectNode s,- Triple n rdfPredicateNode p',- Triple n rdfObjectNode o- ]+ pure [ Triple n rdfTypeNode rdfStatementNode+ , Triple n rdfSubjectNode s+ , Triple n rdfPredicateNode p'+ , Triple n rdfObjectNode o ] -------------------------------------------------------------------------------- -- URI checks@@ -580,43 +541,40 @@ checkIRI msg iri = do bUri <- maybe mempty unBaseUrl <$> currentBaseUri case uriValidate iri of- Nothing -> throwError $ mconcat ["Malformed IRI for \"", msg, "\": ", T.unpack iri]+ Nothing -> throwError $ mconcat ["Malformed IRI for \"", msg, "\": ", T.unpack iri] Just iri' -> either throwError pure (resolveIRI bUri iri') -- https://www.w3.org/TR/rdf-syntax-grammar/#propertyAttributeURIs isPropertyAttrURI :: Text -> Bool-isPropertyAttrURI uri =- isNotCoreSyntaxTerm uri- && uri /= rdfDescription- && uri /= rdfLi- && isNotOldTerm uri+isPropertyAttrURI uri+ = isNotCoreSyntaxTerm uri+ && uri /= rdfDescription+ && uri /= rdfLi+ && isNotOldTerm uri -- https://www.w3.org/TR/rdf-syntax-grammar/#coreSyntaxTerms isNotCoreSyntaxTerm :: Text -> Bool-isNotCoreSyntaxTerm uri =- uri /= rdfTag && uri /= rdfID && uri /= rdfAbout- && uri /= rdfParseType- && uri /= rdfResource- && uri /= rdfNodeID- && uri /= rdfDatatype+isNotCoreSyntaxTerm uri+ = uri /= rdfTag && uri /= rdfID && uri /= rdfAbout+ && uri /= rdfParseType && uri /= rdfResource+ && uri /= rdfNodeID && uri /= rdfDatatype -- https://www.w3.org/TR/rdf-syntax-grammar/#oldTerms isNotOldTerm :: Text -> Bool-isNotOldTerm uri =- uri /= rdfAboutEach- && uri /= rdfAboutEachPrefix- && uri /= rdfBagID+isNotOldTerm uri = uri /= rdfAboutEach+ && uri /= rdfAboutEachPrefix+ && uri /= rdfBagID -------------------------------------------------------------------------------- -- Parser's state utils --- | Create a new unique blank node+-- |Create a new unique blank node newBNode :: Parser Node newBNode = do- modify $ \st -> st {stateGenId = stateGenId st + 1}+ modify $ \st -> st { stateGenId = stateGenId st + 1 } BNodeGen . stateGenId <$> get --- | Process a parser, restoring the state except for stateGenId and stateIdSet+-- |Process a parser, restoring the state except for stateGenId and stateIdSet keepState :: Parser a -> Parser a keepState p = do st <- get@@ -629,8 +587,8 @@ is' = stateIdSet st' -- Update the set of ID if necessary if bUri /= bUri'- then put (st {stateGenId = i})- else put (st {stateGenId = i, stateIdSet = is <> is'})+ then put (st { stateGenId = i })+ else put (st { stateGenId = i, stateIdSet = is <> is' }) currentIdSet :: Parser (Set Text) currentIdSet = stateIdSet <$> get@@ -638,18 +596,13 @@ updateIdSet :: Text -> Parser () updateIdSet i = do is <- currentIdSet- modify (\st -> st {stateIdSet = S.insert i is})--noNodeAttrs :: Parser ()-noNodeAttrs = do- atts <- currentNodeAttrs- guard (HM.null atts)+ modify (\st -> st { stateIdSet = S.insert i is }) currentNodeAttrs :: Parser (HashMap Text Text) currentNodeAttrs = stateNodeAttrs <$> get setNodeAttrs :: HashMap Text Text -> Parser ()-setNodeAttrs as = modify (\st -> st {stateNodeAttrs = as})+setNodeAttrs as = modify (\st -> st { stateNodeAttrs = as }) removeNodeAttr :: Text -> Parser () removeNodeAttr a = HM.delete a <$> currentNodeAttrs >>= setNodeAttrs@@ -660,14 +613,14 @@ updatePrefixMappings :: PrefixMappings -> Parser PrefixMappings updatePrefixMappings pm = do pm' <- (<> pm) <$> currentPrefixMappings- modify (\st -> st {statePrefixMapping = pm'})+ modify (\st -> st { statePrefixMapping = pm' }) pure pm' currentCollectionIndex :: Parser Int currentCollectionIndex = stateCollectionIndex <$> get setCollectionIndex :: Int -> Parser ()-setCollectionIndex i = modify (\st -> st {stateCollectionIndex = i})+setCollectionIndex i = modify (\st -> st { stateCollectionIndex = i }) keepCollectionIndex :: Parser a -> Parser a keepCollectionIndex p = do@@ -677,34 +630,33 @@ -- See: https://www.w3.org/TR/rdf-syntax-grammar/#section-List-Expand nextCollectionIndex :: Parser Text nextCollectionIndex = do- modify $ \st -> st {stateCollectionIndex = stateCollectionIndex st + 1}+ modify $ \st -> st { stateCollectionIndex = stateCollectionIndex st + 1 } (rdfListIndex <>) . T.pack . show . stateCollectionIndex <$> get resetCollectionIndex :: Parser ()-resetCollectionIndex = modify $ \st -> st {stateCollectionIndex = 0}+resetCollectionIndex = modify $ \st -> st { stateCollectionIndex = 0 } currentBaseUri :: Parser (Maybe BaseUrl) currentBaseUri = stateBaseUri <$> get setBaseUri :: (Maybe BaseUrl) -> Parser ()-setBaseUri u = modify (\st -> st {stateBaseUri = u})+setBaseUri u = modify (\st -> st { stateBaseUri = u }) mkUNodeID :: Text -> Parser Node mkUNodeID t = mkUnode <$> currentBaseUri where- mkUnode =- unode . \case- Nothing -> t- Just (BaseUrl u) -> mconcat [u, "#", t]+ mkUnode = unode . \case+ Nothing -> t+ Just (BaseUrl u) -> mconcat [u, "#", t] currentSubject :: Parser (Maybe Subject) currentSubject = stateSubject <$> get setSubject :: (Maybe Subject) -> Parser ()-setSubject s = modify (\st -> st {stateSubject = s})+setSubject s = modify (\st -> st { stateSubject = s }) currentLang :: Parser (Maybe Text) currentLang = stateLang <$> get setLang :: (Maybe Text) -> Parser ()-setLang lang = modify (\st -> st {stateLang = lang})+setLang lang = modify (\st -> st { stateLang = lang })
+ testsuite/tests/Data/RDF/BlankNodeTests.hs view
@@ -0,0 +1,34 @@+{-# LANGUAGE OverloadedStrings #-}++module Data.RDF.BlankNodeTests+ ( blankNodeTests,+ )+where++import Data.Either+import Data.RDF.IRI+import Data.RDF.Types+import Data.Text ()+import Test.Tasty+import Test.Tasty.HUnit++blankNodeTests :: TestTree+blankNodeTests =+ testGroup+ "blank-node-unit-tests"+ [ testCase "valid-bnode" $+ assertEqual+ ""+ (Just (BNode "foo"))+ (bnode "_:foo"),+ testCase "invalid-bnode1" $+ assertEqual+ ""+ Nothing+ (bnode "_foo"),+ testCase "invalid-bnode2" $+ assertEqual+ ""+ Nothing+ (bnode ":foo")+ ]
testsuite/tests/Data/RDF/IRITests.hs view
@@ -1,136 +1,165 @@ {-# LANGUAGE OverloadedStrings #-} module Data.RDF.IRITests- ( iriTests- ) where + ( iriTests,+ )+where import Data.Either+import Data.RDF.IRI import Data.Text ()-import Data.RDF.IRI - import Test.Tasty import Test.Tasty.HUnit iriTests :: TestTree iriTests =- testGroup "iri-unit-tests"- [ testCase "No scheme 01" $- assertEqual ""- (Right (IRIRef Nothing authority02 mempty Nothing Nothing))- (parseRelIRI "//duckduckgo.com")- , testCase "No scheme 02" $- assertBool "" (isRight (parseRelIRI "duckduckgo.com"))- , testCase "No path" $- assertEqual ""- (Right (IRIRef https authority01 mempty Nothing Nothing))- (parseIRI "https://en.wikipedia.org")- , testCase "Scheme case" $- assertEqual ""- (Right (IRIRef https authority01 mempty Nothing Nothing))- (parseIRI "htTpS://en.wikipedia.org")- , testCase "Empty query" $- assertEqual ""- (Right (IRIRef https authority02 mempty (Just mempty) Nothing))- (parseIRI "https://duckduckgo.com?")- , testCase "Empty fragment" $- assertEqual ""- (Right (IRIRef https authority02 mempty Nothing (Just mempty)))- (parseIRI "https://duckduckgo.com#")- , testCase "Empty query & fragment" $- assertEqual ""- (Right (IRIRef https authority02 mempty (Just mempty) (Just mempty)))- (parseIRI "https://duckduckgo.com?#")- , testCase "Simple query without path" $- assertEqual ""- (Right (IRIRef https authority02 mempty query01 Nothing))- (parseIRI "https://duckduckgo.com?q=Uniform+Resource+Identifier")- , testCase "Simple query with path" $- assertEqual ""- (Right (IRIRef https authority02 (Path "/") query01 Nothing))- (parseIRI "https://duckduckgo.com/?q=Uniform+Resource+Identifier")- , testCase "Japanese characters 01" $- assertEqual ""- (Right (IRIRef https authority03 mempty Nothing Nothing))- (parseIRI "https://www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp")- , testCase "Empty Filepath" $- assertEqual ""- (Right (IRIRef file emptyAuthority mempty Nothing Nothing))- (parseIRI "file://")- , testCase "Simple Filepath 01" $- assertEqual ""- (Right (IRIRef file emptyAuthority (Path "/") Nothing Nothing))- (parseIRI "file:///")- , testCase "Simple Filepath 02" $- assertEqual ""- (Right (IRIRef file emptyAuthority (Path "/temp") Nothing Nothing))- (parseIRI "file:///temp")- , testCase "Simple Filepath 03" $- assertEqual ""- (Right (IRIRef file emptyAuthority (Path "/temp/test.txt") Nothing Nothing))- (parseIRI "file:///temp/test.txt")- , testCase "Example for IRI resolution 1" $- assertEqual ""- (Right (IRIRef http authority04 (Path "/bb/ccc/d;p") (Just $ Query "q") Nothing))- (parseIRI "http://a/bb/ccc/d;p?q")- , testCase "Example for IRI resolution 2" $- assertEqual ""- (Right (IRIRef (Just $ Scheme "g") Nothing (Path "h") Nothing Nothing))- (parseIRI "g:h")- , testCase "Example for IRI resolution 3a" $- assertBool "" (isLeft (parseIRI "g"))- , testCase "Example for IRI resolution 3b" $- assertEqual ""- (Right (IRIRef Nothing Nothing (Path "g") Nothing Nothing))- (parseRelIRI "g")- , testCase "Example for IRI resolution 4" $- assertEqual ""- (Right (IRIRef Nothing Nothing (Path "..") Nothing Nothing))- (parseRelIRI "..")- , testCase "IRI resolution 0" $- assertEqual ""- (Right "http://a/bb/ccc/d;p?q")- (resolveIRI "http://a/bb/ccc/d;p?q" "")- , testCase "IRI resolution 1" $- assertEqual ""- (Right "g:h")- (resolveIRI "http://a/bb/ccc/d;p?q" "g:h")- , testCase "IRI resolution 2" $- assertEqual ""- (Right "http://a/bb/ccc/g")- (resolveIRI "http://a/bb/ccc/d;p?q" "g")- , testCase "IRI resolution 3" $- assertEqual ""- (Right "http://a/bb/ccc/g")- (resolveIRI "http://a/bb/ccc/d;p?q" "./g")- , testCase "IRI resolution 4" $- assertEqual ""- (Right "http://a/bb/ccc/g/")- (resolveIRI "http://a/bb/ccc/d;p?q" "g/")- , testCase "IRI resolution 5" $- assertEqual ""- (Right "http://a/g")- (resolveIRI "http://a/bb/ccc/d;p?q" "/g")- , testCase "IRI resolution 6" $- assertEqual ""- (Right "http://a/bb/ccc/g/")- (resolveIRI "http://a/bb/ccc/d;p?q" "./g/.")- , testCase "IRI resolution 7" $- assertEqual ""- (Right "http://a/bb/")- (resolveIRI "http://a/bb/ccc/d;p?q" "..")- , testCase "IRI resolution 8" $- assertEqual ""- (Right "http://a/g")- (resolveIRI "http://a/bb/ccc/d;p?q" "../../../g")- , testCase "IRI resolution 9" $- assertEqual ""- (Right "http://a.com/bb/ccc/test.ttl#")- (resolveIRI "http://a.com/bb/ccc/test.ttl" "#")- , testCase "IRI resolution 10" $- assertEqual ""- (Right "http://a/bb/ccc/d;p?q#")- (resolveIRI "http://a/bb/ccc/d;p?q" "#")- ]+ testGroup+ "iri-unit-tests"+ [ testCase "No scheme 01" $+ assertEqual+ ""+ (Right (IRIRef Nothing authority02 mempty Nothing Nothing))+ (parseRelIRI "//duckduckgo.com"),+ testCase "No scheme 02" $+ assertBool "" (isRight (parseRelIRI "duckduckgo.com")),+ testCase "No path" $+ assertEqual+ ""+ (Right (IRIRef https authority01 mempty Nothing Nothing))+ (parseIRI "https://en.wikipedia.org"),+ testCase "Scheme case" $+ assertEqual+ ""+ (Right (IRIRef https authority01 mempty Nothing Nothing))+ (parseIRI "htTpS://en.wikipedia.org"),+ testCase "Empty query" $+ assertEqual+ ""+ (Right (IRIRef https authority02 mempty (Just mempty) Nothing))+ (parseIRI "https://duckduckgo.com?"),+ testCase "Empty fragment" $+ assertEqual+ ""+ (Right (IRIRef https authority02 mempty Nothing (Just mempty)))+ (parseIRI "https://duckduckgo.com#"),+ testCase "Empty query & fragment" $+ assertEqual+ ""+ (Right (IRIRef https authority02 mempty (Just mempty) (Just mempty)))+ (parseIRI "https://duckduckgo.com?#"),+ testCase "Simple query without path" $+ assertEqual+ ""+ (Right (IRIRef https authority02 mempty query01 Nothing))+ (parseIRI "https://duckduckgo.com?q=Uniform+Resource+Identifier"),+ testCase "Simple query with path" $+ assertEqual+ ""+ (Right (IRIRef https authority02 (Path "/") query01 Nothing))+ (parseIRI "https://duckduckgo.com/?q=Uniform+Resource+Identifier"),+ testCase "Japanese characters 01" $+ assertEqual+ ""+ (Right (IRIRef https authority03 mempty Nothing Nothing))+ (parseIRI "https://www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp"),+ testCase "Empty Filepath" $+ assertEqual+ ""+ (Right (IRIRef file emptyAuthority mempty Nothing Nothing))+ (parseIRI "file://"),+ testCase "Simple Filepath 01" $+ assertEqual+ ""+ (Right (IRIRef file emptyAuthority (Path "/") Nothing Nothing))+ (parseIRI "file:///"),+ testCase "Simple Filepath 02" $+ assertEqual+ ""+ (Right (IRIRef file emptyAuthority (Path "/temp") Nothing Nothing))+ (parseIRI "file:///temp"),+ testCase "Simple Filepath 03" $+ assertEqual+ ""+ (Right (IRIRef file emptyAuthority (Path "/temp/test.txt") Nothing Nothing))+ (parseIRI "file:///temp/test.txt"),+ testCase "Example for IRI resolution 1" $+ assertEqual+ ""+ (Right (IRIRef http authority04 (Path "/bb/ccc/d;p") (Just $ IRIQuery "q") Nothing))+ (parseIRI "http://a/bb/ccc/d;p?q"),+ testCase "Example for IRI resolution 2" $+ assertEqual+ ""+ (Right (IRIRef (Just $ Scheme "g") Nothing (Path "h") Nothing Nothing))+ (parseIRI "g:h"),+ testCase "Example for IRI resolution 3a" $+ assertBool "" (isLeft (parseIRI "g")),+ testCase "Example for IRI resolution 3b" $+ assertEqual+ ""+ (Right (IRIRef Nothing Nothing (Path "g") Nothing Nothing))+ (parseRelIRI "g"),+ testCase "Example for IRI resolution 4" $+ assertEqual+ ""+ (Right (IRIRef Nothing Nothing (Path "..") Nothing Nothing))+ (parseRelIRI ".."),+ testCase "IRI resolution 0" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/d;p?q")+ (resolveIRI "http://a/bb/ccc/d;p?q" ""),+ testCase "IRI resolution 1" $+ assertEqual+ ""+ (Right "g:h")+ (resolveIRI "http://a/bb/ccc/d;p?q" "g:h"),+ testCase "IRI resolution 2" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/g")+ (resolveIRI "http://a/bb/ccc/d;p?q" "g"),+ testCase "IRI resolution 3" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/g")+ (resolveIRI "http://a/bb/ccc/d;p?q" "./g"),+ testCase "IRI resolution 4" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/g/")+ (resolveIRI "http://a/bb/ccc/d;p?q" "g/"),+ testCase "IRI resolution 5" $+ assertEqual+ ""+ (Right "http://a/g")+ (resolveIRI "http://a/bb/ccc/d;p?q" "/g"),+ testCase "IRI resolution 6" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/g/")+ (resolveIRI "http://a/bb/ccc/d;p?q" "./g/."),+ testCase "IRI resolution 7" $+ assertEqual+ ""+ (Right "http://a/bb/")+ (resolveIRI "http://a/bb/ccc/d;p?q" ".."),+ testCase "IRI resolution 8" $+ assertEqual+ ""+ (Right "http://a/g")+ (resolveIRI "http://a/bb/ccc/d;p?q" "../../../g"),+ testCase "IRI resolution 9" $+ assertEqual+ ""+ (Right "http://a.com/bb/ccc/test.ttl#")+ (resolveIRI "http://a.com/bb/ccc/test.ttl" "#"),+ testCase "IRI resolution 10" $+ assertEqual+ ""+ (Right "http://a/bb/ccc/d;p?q#")+ (resolveIRI "http://a/bb/ccc/d;p?q" "#")+ ] http :: Maybe Scheme http = Just $ Scheme "http"@@ -165,8 +194,8 @@ host03 :: Host host03 = Host "www.ほんとうにながいわけのわからないどめいんめいのらべるまだながくしないとたりない.w3.mag.keio.ac.jp" -query01 :: Maybe Query-query01 = Just $ Query "q=Uniform+Resource+Identifier"+query01 :: Maybe IRIQuery+query01 = Just $ IRIQuery "q=Uniform+Resource+Identifier" {- fragment01 :: Maybe Fragment
testsuite/tests/Test.hs view
@@ -5,33 +5,35 @@ import Data.Maybe (fromJust) import Data.RDF-import Data.RDF.GraphImplTests-import Data.RDF.PropertyTests-import Data.RDF.IRITests+import Data.RDF.BlankNodeTests+import Data.RDF.GraphImplTests+import Data.RDF.IRITests+import Data.RDF.PropertyTests import qualified Data.Text as T-import System.FilePath ((</>)) import System.Directory (getCurrentDirectory)-import Test.Tasty (defaultMain,testGroup)+import System.FilePath ((</>))+import Test.Tasty (defaultMain, testGroup)+import qualified Text.RDF.RDF4H.TurtleParser_ConformanceTest as TurtleUnitTest+import qualified Text.RDF.RDF4H.TurtleSerializerTest as TurtleSerializerTest+import qualified Text.RDF.RDF4H.XmlParser_Test as XmlUnitTest import W3C.Manifest import qualified W3C.NTripleTest as W3CNTripleTest import qualified W3C.RdfXmlTest as W3CRdfXmlTest import qualified W3C.TurtleTest as W3CTurtleTest-import qualified Text.RDF.RDF4H.TurtleParser_ConformanceTest as TurtleUnitTest-import qualified Text.RDF.RDF4H.XmlParser_Test as XmlUnitTest -suiteFilesDirTurtle,suiteFilesDirXml,suiteFilesDirNTriples :: T.Text+suiteFilesDirTurtle, suiteFilesDirXml, suiteFilesDirNTriples :: T.Text suiteFilesDirTurtle = "rdf-tests/turtle/" suiteFilesDirXml = "rdf-tests/rdf-xml/" suiteFilesDirNTriples = "rdf-tests/ntriples/" -mfPathTurtle,mfPathXml,mfPathNTriples :: T.Text+mfPathTurtle, mfPathXml, mfPathNTriples :: T.Text mfPathTurtle = mconcat [suiteFilesDirTurtle, "manifest.ttl"] mfPathXml = mconcat [suiteFilesDirXml, "manifest.ttl"] mfPathNTriples = mconcat [suiteFilesDirNTriples, "manifest.ttl"] -mfBaseURITurtle,mfBaseURIXml,mfBaseURINTriples :: BaseUrl-mfBaseURITurtle = W3CTurtleTest.mfBaseURITurtle-mfBaseURIXml = W3CRdfXmlTest.mfBaseURIXml+mfBaseURITurtle, mfBaseURIXml, mfBaseURINTriples :: BaseUrl+mfBaseURITurtle = W3CTurtleTest.mfBaseURITurtle+mfBaseURIXml = W3CRdfXmlTest.mfBaseURIXml mfBaseURINTriples = BaseUrl "http://www.w3.org/2013/N-TriplesTests/" main :: IO ()@@ -47,67 +49,67 @@ loadManifest mfPathNTriples (fileSchemeUri suiteFilesDirNTriples) -- run tests defaultMain- (testGroup- "rdf4h tests"- -- RDF graph API tests- [ testGroup- "property-tests"- [(graphTests- "TList"- (empty :: RDF TList)- (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF TList))- ,- (graphTests- "AdjHashMap"- (empty :: RDF AdjHashMap)- (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF AdjHashMap))- ,- (graphTests- "AlgebraicGraph"- (empty :: RDF AlgebraicGraph)- (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF AlgebraicGraph))]- ,- testGroup- "graph-impl-unit-tests"- [ graphImplTests ]- ,- testGroup- "iri"- [ iriTests ]- ,-- -- RDF parser unit tests- testGroup "parser-unit-tests-turtle"- TurtleUnitTest.tests- ,- testGroup "parser-unit-tests-xml"- XmlUnitTest.tests- ,-- -- RDF parser W3C tests- testGroup- "parser-w3c-tests-ntriples"- [ testGroup- "parser-w3c-tests-ntriples-parsec"- [W3CNTripleTest.testsParsec nTriplesManifest]- , testGroup- "parser-w3c-tests-ntriples-attoparsec"- [W3CNTripleTest.testsAttoparsec nTriplesManifest]- ]- ,- testGroup- "parser-w3c-tests-turtle"- [ testGroup- "parser-w3c-tests-turtle-parsec"- [W3CTurtleTest.testsParsec (dir </> T.unpack suiteFilesDirTurtle) turtleManifest]- , testGroup- "parser-w3c-tests-turtle-attoparsec"- [W3CTurtleTest.testsAttoparsec (dir </> T.unpack suiteFilesDirTurtle) turtleManifest]- ]- ,- testGroup- "parser-w3c-tests-xml"- [ W3CRdfXmlTest.tests (dir </> T.unpack suiteFilesDirXml) xmlManifest- ]- ]+ ( testGroup+ "rdf4h tests"+ -- RDF graph API tests+ [ testGroup+ "property-tests"+ [ ( graphTests+ "TList"+ (empty :: RDF TList)+ (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF TList)+ ),+ ( graphTests+ "AdjHashMap"+ (empty :: RDF AdjHashMap)+ (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF AdjHashMap)+ ),+ ( graphTests+ "AlgebraicGraph"+ (empty :: RDF AlgebraicGraph)+ (mkRdf :: Triples -> Maybe BaseUrl -> PrefixMappings -> RDF AlgebraicGraph)+ )+ ],+ testGroup+ "graph-impl-unit-tests"+ [graphImplTests],+ testGroup+ "iri"+ [iriTests],+ testGroup+ "bnode"+ [blankNodeTests],+ -- RDF parser unit tests+ testGroup+ "parser-unit-tests-turtle"+ TurtleUnitTest.tests,+ testGroup+ "parser-unit-tests-xml"+ XmlUnitTest.tests,+ -- RDF serializer unit tests+ testGroup "serializer-unit-tests-turtle" [TurtleSerializerTest.tests],+ -- RDF parser W3C tests+ testGroup+ "parser-w3c-tests-ntriples"+ [ testGroup+ "parser-w3c-tests-ntriples-parsec"+ [W3CNTripleTest.testsParsec nTriplesManifest],+ testGroup+ "parser-w3c-tests-ntriples-attoparsec"+ [W3CNTripleTest.testsAttoparsec nTriplesManifest]+ ],+ testGroup+ "parser-w3c-tests-turtle"+ [ testGroup+ "parser-w3c-tests-turtle-parsec"+ [W3CTurtleTest.testsParsec (dir </> T.unpack suiteFilesDirTurtle) turtleManifest],+ testGroup+ "parser-w3c-tests-turtle-attoparsec"+ [W3CTurtleTest.testsAttoparsec (dir </> T.unpack suiteFilesDirTurtle) turtleManifest]+ ],+ testGroup+ "parser-w3c-tests-xml"+ [ W3CRdfXmlTest.tests (dir </> T.unpack suiteFilesDirXml) xmlManifest+ ]+ ] )
+ testsuite/tests/Text/RDF/RDF4H/TurtleSerializerTest.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE OverloadedStrings #-}++module Text.RDF.RDF4H.TurtleSerializerTest (tests) where++import Data.ByteString as BS++import Data.RDF.Namespace+import Data.Function ((&))+import Data.Map as Map+import Data.RDF as RDF+import Text.RDF.RDF4H.TurtleSerializer.Internal+import System.IO+import System.IO.Temp (withSystemTempFile)+import Test.Tasty+import Test.Tasty.HUnit++tests :: TestTree+tests = testGroup "Turtle serializer tests"+ [ testGroup "findMappings Tests"+ [ testCase "findMapping correctly finds rdf mapping" $+ assertEqual "" (Just ("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "subject")) (findMapping standard_ns_mappings "rdf:subject")+ , testCase "findMapping correctly finds rdfs mapping" $+ assertEqual "" (Just ("http://www.w3.org/2000/01/rdf-schema#", "domain")) (findMapping standard_ns_mappings "rdfs:domain")]++ , testGroup "writeUNodeUri tests"+ [ testCase "Serialization of QName UNode where prefix exists in PrefixMappings should not contain < or >" $+ withSystemTempFile "rdf4h-"+ (\_ h -> do+ writeUNodeUri h "rdf:subject" standard_ns_mappings+ hSeek h AbsoluteSeek 0+ contents <- BS.hGetContents h+ "rdf:subject" @=? contents)+ , testCase "Serialization of QName UNode where prefix does not exist in PrefixMappings should not contain < or >" $+ withSystemTempFile "rdf4h-"+ (\_ h -> do+ writeUNodeUri h "foo:subject" standard_ns_mappings+ hSeek h AbsoluteSeek 0+ contents <- BS.hGetContents h+ "foo:subject" @=? contents)+ , testCase "Serialization of non-namespaced UNode should be wrapped in < and >" $+ withSystemTempFile "rdf4h-"+ (\_ h -> do+ writeUNodeUri h "http://www.w3.org/1999/02/22-rdf-syntax-ns#subject" standard_ns_mappings+ hSeek h AbsoluteSeek 0+ contents <- BS.hGetContents h+ "<http://www.w3.org/1999/02/22-rdf-syntax-ns#subject>" @=? contents)+ ]++ , testGroup "writeRdf tests"+ [ testCase "triples with the same subject should be grouped" $+ let g :: RDF TList+ g = RDF.empty+ & flip addTriple (triple (unode ":something") (unode "rdf:type") (unode "schema:Document"))+ & flip addTriple (triple (unode ":another") (unode "rdf:type") (unode "schema:Document"))+ & flip addTriple (triple (unode ":something") (unode "dc:title") (lnode (plainL "Some title")))+ mappings = PrefixMappings $ Map.fromList [ ("schema", "http://schema.org/")+ , ("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")+ , ("dc", "http://purl.org/dc/elements/1.1/")]+ serializer = TurtleSerializer Nothing mappings+ in+ withSystemTempFile "rdf4h-"+ (\_ h -> do+ expected <- BS.readFile "testsuite/tests/Text/RDF/RDF4H/data/common-subject.ttl"+ hWriteRdf serializer h g+ hSeek h AbsoluteSeek 0+ actual <- BS.hGetContents h+ expected @=? actual)+ ]+ ]
testsuite/tests/W3C/W3CAssertions.hs view
@@ -50,7 +50,7 @@ assertIsNotParsed :: IO (Either ParseFailure (RDF TList)) -> TU.Assertion assertIsNotParsed r1 = do gr1 <- r1- TU.assertBool ("parsed unexpectantly:\n" <> show gr1) (not (isParsed gr1))+ TU.assertBool ("parsed unexpectedly:\n" <> show gr1) (not (isParsed gr1)) isParsed :: Either a b -> Bool isParsed (Left _) = False