-- LOG_ENABLE(2,1) ; -- Clear Introspection Graph associated with these views SPARQL CLEAR GRAPH ; -- SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; -- ABox Data SPARQL CLEAR GRAPH ; -- SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; -- Load Data -- iPhone Products and Offers From OSDS Uploads (via SPARQL Upload Feature) SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; SPARQL ADD TO ; -- Sponged Data with cache-invalidation enabled via pragmas -- iPhone Products and Offers From OSDS Uploads (via SPARQL Upload Feature) SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; SPARQL DEFINE get:soft "soft" LOAD INTO ; -- Other Products & Offers SPARQL INSERT { GRAPH { ?s a schema:Product . ?s schema:name ?name . ?s schema:image ?image . ?s schema:offers ?offer . ?s schema:sku ?sku . ?s schema:description ?description . ?s schema:brand ?brand . ?s schema:price ?price . ?s schema:maintEntityOfPage ?page . ?s schema:url ?url . } } WHERE { { SELECT * WHERE { GRAPH ?g { ?s a schema:Product . ?s schema:name ?name . OPTIONAL { ?s schema:mainEntityOfPage ?pageURL } . BIND (?pageURL AS ?page ) . OPTIONAL { ?s schema:url ?webPageURL } . BIND (?webPageURL AS ?url ) . OPTIONAL { ?s schema:image ?imageURL } . BIND (?imageURL AS ?image ) . OPTIONAL { ?s schema:offers ?offer } . OPTIONAL { ?s schema:sku ?sku } . ?s schema:description ?description . OPTIONAL { ?s schema:brand ?brand } . # FILTER (CONTAINS(STR(?name), 'iPhone')) # FILTER (LANG(?description) = "en") # FILTER (LANG(?name) = "en") OPTIONAL {?offer schema:name ?offerName . ?offer schema:price ?offerPrice . ?offer schema:sku ?offerSku }. } } } } LIMIT 1000 ; -- Check -- SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; -- Cleanup SPARQL CLEAR GRAPH ; SPARQL SELECT COUNT(*) FROM WHERE {?s ?p ?o} ; -- GraphQL Mapping Graph SPARQL PREFIX rdf: PREFIX rdfs: PREFIX owl: PREFIX dbo: PREFIX dbp: PREFIX gql: PREFIX dct: INSERT DATA INTO { # Schema.Org to GraphQL Entity & Property Mappings gql:Map gql:schemaObjects gql:Product, gql:Products, gql:Offer, gql:Offers ; # Target GraphQL Entity Types List gql:dataGraph ; # DBpedia ABox Graph gql:schemaGraph . # This Schema and Mappings # Schema.org Product Class to GraphQL Entity Type Mappings # gql:Product gql:type gql:Object ; gql:rdfClass schema:Product . gql:Products gql:type gql:Array ; gql:rdfClass schema:Product . gql:Offer gql:type gql:Object ; gql:rdfClass schema:Offer . gql:Offers gql:type gql:Array ; gql:rdfClass schema:Offer . # GraphQL Entity Field (Property) to Schema.org Product Property Mappings # schema:offers a owl:ObjectProperty ; rdfs:range schema:Offer ; rdfs:domain schema:Product ; gql:type gql:Array ; gql:field gql:offers . schema:mainEntityOfPage a owl:ObjectProperty ; rdfs:range schema:URL ; rdfs:domain schema:Product ; gql:type gql:Array ; # gql:type gql:Scalar ; gql:field gql:mainEntityOfPage . schema:image a owl:DatatypeProperty ; rdfs:range schema:URL ; rdfs:domain schema:Product ; gql:type gql:Array ; # gql:type gql:Scalar ; gql:field gql:image . schema:url a owl:DatatypeProperty ; rdfs:range schema:URL ; rdfs:domain schema:Product ; gql:type gql:Array ; # gql:type gql:Scalar ; gql:field gql:url . schema:potentialAction a owl:DatatypeProperty ; rdfs:range schema:Action ; rdfs:domain schema:Product, schema:Offer ; gql:type gql:Array ; # gql:type gql:Scalar ; gql:field gql:potentialAction . schema:name a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product, schema:Offer ; gql:type gql:Scalar ; gql:field gql:name . schema:description a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product ; gql:type gql:Scalar ; gql:field gql:description . schema:sku a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product, schema:Offer ; gql:type gql:Scalar ; gql:field gql:sku . schema:brand a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product ; gql:type gql:Scalar ; gql:field gql:brand . schema:price a owl:DatatypeProperty ; rdfs:range xsd:decimal ; rdfs:domain schema:Product, schema:Offer ; gql:type gql:Scalar ; gql:field gql:price . schema:priceCurrency a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Offer ; gql:type gql:Scalar ; gql:field gql:priceCurrency . schema:lowPrice a owl:DatatypeProperty ; rdfs:range xsd:decimal ; rdfs:domain schema:Offer ; gql:type gql:Scalar ; gql:field gql:lowPrice . schema:highPrice a owl:DatatypeProperty ; rdfs:range xsd:decimal ; rdfs:domain schema:Offer ; gql:type gql:Scalar ; gql:field gql:highPrice . } ; -- Update GQL Bridge Type Schema GQL_INIT_TYPE_SCHEMA(); -- Initialize GQL Type Schema for modification GQL_INTRO_DEL ('urn:graphql:intro:schemaorg:products'); -- Delete Instrospection Data from the GQL Bridge Type System Schema TTLP (GQL_CREATE_TYPE_SCHEMA ('urn:graphql:schemaorg:bridge:products'), '', 'urn:graphql:intro:schemaorg:products'); -- Generate Introspection Data GQL_INTRO_ADD ('urn:graphql:intro:schemaorg:products'); -- Add modified Instrospection Data to GQL Bridge Type System Schema