-- -- Other Job Postings & Associated Organizations SPARQL INSERT { GRAPH { ?s a schema:JobPosting . ?s schema:name ?name . ?s schema:title ?title . ?s schema:description ?jobDesc . ?s schema:datePosted ?datePosted . ?s schema:validThrough ?valid . ?s schema:employmentType ?jobType . ?s schema:hiringOrganization ?org . ?org schema:name ?orgName . ?org schema:description ?orgDesc . } } WHERE { { SELECT * WHERE { GRAPH ?g { ?s a schema:JobPosting . OPTIONAL {?s schema:name ?name} . OPTIONAL { ?s schema:title ?title } . OPTIONAL { ?s schema:description ?jobDesc } . OPTIONAL { ?s schema:datePosted ?datePosted } . OPTIONAL { ?s schema:validThrough ?valid } . OPTIONAL { ?s schema:employmentType ?jobType } . OPTIONAL { ?s schema:hiringOrganization ?org } . OPTIONAL {?org schema:name ?orgName } . OPTIONAL {?org schema:description ?orgDesc }. } } } } LIMIT 1000 ; -- 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, gql:WebPage, gql:FAQPage, gql:FAQPages, gql:Question, gql:Questions, gql:Answer, gql:Answers, gql:Images, gql:Actions, gql:Url, gql:JobPosting, gql:JobPostings, gql:Organization, gql:Organizations ; # Target GraphQL Entity Types List gql:dataGraph ; # Instance Data (ABox) Graph gql:schemaGraph . # This Schema and Mappings # Schema.org Product Class to GraphQL Entity Type Mappings # gql:SchemaProduct gql:type gql:Object ; gql:rdfClass schema:Product . gql:SchemaProducts 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 . gql:WebPage gql:type gql:Object ; gql:rdfClass schema:WebPage . gql:FAQPage gql:type gql:Object ; gql:rdfClass schema:FAQPage . gql:FAQPages gql:type gql:Array ; gql:rdfClass schema:FAQPage . gql:Question gql:type gql:Object ; gql:rdfClass schema:Question . gql:Questions gql:type gql:Array ; gql:rdfClass schema:Question . gql:Answer gql:type gql:Object ; gql:rdfClass schema:Answer . gql:Answers gql:type gql:Array ; gql:rdfClass schema:Answer . gql:Images gql:type gql:Array ; gql:rdfClass schema:Image . gql:Actions gql:type gql:Array ; gql:rdfClass schema:Action . gql:Url gql:type gql:Object ; gql:rdfClass schema:URL . gql:JobPosting gql:type gql:Object ; gql:rdfClass schema:JobPosting . gql:JobPostings gql:type gql:Array ; gql:rdfClass schema:JobPosting . gql:Organization gql:type gql:Object ; gql:rdfClass schema:Organization . gql:Organizations gql:type gql:Array ; gql:rdfClass schema:Organization . # GraphQL Entity Field (Property) to Schema.org Product Property Mappings # schema:offers a owl:ObjectProperty ; rdfs:range schema:Offer ; rdfs:domain schema:Product, schema:FAQPage; gql:type gql:Array ; gql:field gql:offers . schema:mainEntityOfPage a owl:ObjectProperty ; rdfs:range schema:WebPage ; rdfs:domain schema:Product ; # gql:type gql:Array ; gql:type gql:Scalar ; gql:field gql:mainEntityOfPage . schema:mainEntity a owl:ObjectProperty ; rdfs:range schema:Question, schema:Answer ; rdfs:domain schema:FAQPage ; gql:type gql:Array ; # gql:type gql:Scalar ; gql:field gql:mainEntity . schema:image a owl:ObjectProperty ; rdfs:range schema:Image ; rdfs:domain schema:Product, schema:FAQPage ; # gql:type gql:Array ; gql:type gql:Scalar ; gql:field gql:image . schema:url a owl:ObjectProperty ; rdfs:range schema:URL ; rdfs:domain schema:Product, schema:FAQPage ; # gql:type gql:Array ; gql:type gql:Scalar ; gql:field gql:url . schema:potentialAction a owl:ObjectProperty ; rdfs:range schema:Action ; rdfs:domain schema:Product, schema:Offer ; # gql:type gql:Array ; gql:type gql:Scalar ; gql:field gql:potentialAction . schema:acceptedAnswer a owl:ObjectProperty ; rdfs:range schema:Answer ; rdfs:domain schema:Question ; # gql:type gql:Array ; gql:type gql:Scalar ; gql:field gql:acceptedAnswer . schema:name a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product, schema:Offer, schema:FAQPage, schema:Question, schema:Organization ; gql:type gql:Scalar ; gql:field gql:name . schema:text a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Answer ; gql:type gql:Scalar ; gql:field gql:text . schema:description a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:Product, schema:JobPosting, schema:Organization ; 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 . schema:datePosted a owl:DatatypeProperty ; rdfs:range xsd:date ; rdfs:domain schema:JobPosting ; gql:type gql:Scalar ; gql:field gql:datePosted . schema:validThrough a owl:DatatypeProperty ; rdfs:range xsd:date ; rdfs:domain schema:JobPosting ; gql:type gql:Scalar ; gql:field gql:validThrough. schema:employmentType a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:JobPosting ; gql:type gql:Scalar ; gql:field gql:employmentType . schema:title a owl:DatatypeProperty ; rdfs:range xsd:string ; rdfs:domain schema:JobPosting ; gql:type gql:Scalar ; gql:field gql:title . # schema:hiringOrganization a owl:ObjectProperty ; schema:hiringOrganization a owl:ObjectProperty ; rdfs:range schema:Organization ; rdfs:domain schema:JobPosting ; gql:type gql:Scalar ; gql:field gql:hiringOrganization . } ; -- Clear Introspection Graph SPARQL CLEAR GRAPH ; -- 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 TTLP (GQL_GENERATE_INTRO (' type Query { "Offers Collection" Offers(name:String, iri:IRI, price:Float): [Offer] "Products Collection" SchemaProducts(name:String, iri:IRI): [SchemaProduct] "FAQ Pages Collection" FAQPages(name:String, iri:IRI, mainEntity:IRI): [FAQPage] "Questions Collection" Questions(name:String, iri:IRI, mainEntity:IRI): [Question] "Answers Collection" Answers(text:String, iri:IRI): [Answer] "Organizations Collection" Organizations(name:String, iri:IRI): [Organization] "JobPostings Collection" JobPostings(title:String, datePosted: String, validThrough: String, iri:IRI): [JobPosting] } " [Organization class](http://schema.org/Organization) " type Organization { iri: IRI! name: String description: String } " [JobPosting class](http://schema.org/JobPosting) " type JobPosting { iri: IRI! title: String description: String datePosted: String validThrough: String employmentType: String hiringOrganization: [Organization] } " [Product class](http://schema.org/Product) " type SchemaProduct { iri: IRI! name: String description: String sku: String brand: String offers: [Offer] mainEntityOfPage: IRI image: IRI url: IRI potentialAction: IRI } " [Offer class](http://schema.org/Offer) " type Offer { iri: IRI! name: String sku: String potentialAction: IRI price: Float priceCurrency: String lowPrice: Float highPrice: Float } " [FAQPage class](http://schema.org/FAQPage) " type FAQPage { iri: IRI! name: String mainEntity: [Question] url: IRI image: IRI offers: [Offer] } " [Question class](http://schema.org/Question) " type Question { iri: IRI! name: String acceptedAnswer: [Answer] } " [Answer class](http://schema.org/Answer) " type Answer { iri: IRI! text: String } '), '', 'urn:graphql:intro:schemaorg:products'); GQL_INTRO_ADD ('urn:graphql:intro:schemaorg:products'); -- Add modified Instrospection Data to GQL Bridge Type System Schema