customer-counterparty-network.rq 666 B

12345678910111213141516171819202122
  1. PREFIX gesli: <https://gesli.example/ontology#>
  2. PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  3. SELECT ?customerName ?counterpartyType ?counterpartyName ?country ?region
  4. WHERE {
  5. ?customer rdfs:label ?customerName .
  6. {
  7. ?customer gesli:hasCustomerCounterparty ?counterparty .
  8. BIND("客户的客户" AS ?counterpartyType)
  9. }
  10. UNION
  11. {
  12. ?customer gesli:hasSupplierCounterparty ?counterparty .
  13. BIND("客户的供应商" AS ?counterpartyType)
  14. }
  15. ?counterparty rdfs:label ?counterpartyName .
  16. OPTIONAL { ?counterparty gesli:country ?country . }
  17. OPTIONAL { ?counterparty gesli:region ?region . }
  18. }
  19. ORDER BY ?customerName ?counterpartyType