User talk:Wolfgang Fahl: Difference between revisions

From FactGrid
Jump to navigation Jump to search
(→‎claude AI: new section)
No edit summary
Line 51: Line 51:
}
}
</source>
</source>
= Prompt =
the visualization is awkward we want to changes- map to rgb values we give and choose the color not by the distance but by the "lager"
== Claude AI ==
<pre>
#defaultView:Map{"hide":["?line"]}
SELECT * WHERE {
  # Select entities related to a specific item (Q995329)
  ?q wdt:P2 wd:Q995329 .
 
  # Get the number of displaced persons for each entity
  ?q wdt:P1198 ?Umsiedler .
 
  # Get the origin location of the displaced persons
  ?q p:P1198/pq:P95 ?woher .
  ?woher wdt:P48 ?coord1 .
  # Extract latitude and longitude for the origin
  ?woher p:P48/psv:P48 ?valuenode1.
  ?valuenode1 wikibase:geoLatitude ?lat1 .
  ?valuenode1 wikibase:geoLongitude ?lon1.
 
  # Get the internment location
  ?q p:P1198/pq:P216 ?interniert .
  ?interniert wdt:P48 ?coord2 .
  # Extract latitude and longitude for the internment location
  ?interniert p:P48/psv:P48 ?valuenode2.
  ?valuenode2 wikibase:geoLatitude ?lat2 .
  ?valuenode2 wikibase:geoLongitude ?lon2.
 
  # Get the destination location
  ?q p:P1198/pq:P29 ?dest .
  ?dest wdt:P48 ?coord3 .
  # Extract latitude and longitude for the destination
  ?dest p:P48/psv:P48 ?valuenode3.
  ?valuenode3 wikibase:geoLatitude ?lat3 .
  ?valuenode3 wikibase:geoLongitude ?lon3.
 
  # Calculate distances between points
  BIND(geof:distance(?coord1, ?coord2) AS ?dist).
  BIND(geof:distance(?coord2, ?coordD) AS ?dist2).
 
  # Create layer values based on distances (possibly for visualization)
  BIND(floor(?dist/10) AS ?layer).
  BIND(floor(?dist2/10) AS ?layer).
 
  # Create a LINESTRING connecting all three points
  BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ',', STR(?lon3), ' ', STR(?lat3), ')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line)
}
</pre>

Revision as of 14:16, 18 September 2024

SPARQL Suche

claude AI

<source lang='sparql'>

  1. defaultView:Map{"hide":["?line"]}

SELECT * WHERE {

 # Select entities related to a specific item (Q995329)
 ?q wdt:P2 wd:Q995329 .
 
 # Get the number of displaced persons for each entity
 ?q wdt:P1198 ?Umsiedler .
 
 # Get the origin location of the displaced persons
 ?q p:P1198/pq:P95 ?woher .
 ?woher wdt:P48 ?coord1 .
 # Extract latitude and longitude for the origin
 ?woher p:P48/psv:P48 ?valuenode1. 
 ?valuenode1 wikibase:geoLatitude ?lat1 . 
 ?valuenode1 wikibase:geoLongitude ?lon1.
 
 # Get the internment location
 ?q p:P1198/pq:P216 ?interniert .
 ?interniert wdt:P48 ?coord2 .
 # Extract latitude and longitude for the internment location
 ?interniert p:P48/psv:P48 ?valuenode2. 
 ?valuenode2 wikibase:geoLatitude ?lat2 . 
 ?valuenode2 wikibase:geoLongitude ?lon2.
 
 # Get the destination location
 ?q p:P1198/pq:P29 ?dest .
 ?dest wdt:P48 ?coord3 .
 # Extract latitude and longitude for the destination
 ?dest p:P48/psv:P48 ?valuenode3. 
 ?valuenode3 wikibase:geoLatitude ?lat3 . 
 ?valuenode3 wikibase:geoLongitude ?lon3.
 
 # Calculate distances between points
 BIND(geof:distance(?coord1, ?coord2) AS ?dist).
 BIND(geof:distance(?coord2, ?coordD) AS ?dist2).
 
 # Create layer values based on distances (possibly for visualization)
 BIND(floor(?dist/10) AS ?layer).
 BIND(floor(?dist2/10) AS ?layer).
 
 # Create a LINESTRING connecting all three points
 BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ',', STR(?lon3), ' ', STR(?lat3), ')') AS ?str) .
 BIND(STRDT(?str, geo:wktLiteral) AS ?line)

} </source>

Prompt

the visualization is awkward we want to changes- map to rgb values we give and choose the color not by the distance but by the "lager"

Claude AI

#defaultView:Map{"hide":["?line"]}
SELECT * WHERE {
  # Select entities related to a specific item (Q995329)
  ?q wdt:P2 wd:Q995329 .
  
  # Get the number of displaced persons for each entity
  ?q wdt:P1198 ?Umsiedler .
  
  # Get the origin location of the displaced persons
  ?q p:P1198/pq:P95 ?woher .
  ?woher wdt:P48 ?coord1 .
  # Extract latitude and longitude for the origin
  ?woher p:P48/psv:P48 ?valuenode1. 
  ?valuenode1 wikibase:geoLatitude ?lat1 . 
  ?valuenode1 wikibase:geoLongitude ?lon1.
  
  # Get the internment location
  ?q p:P1198/pq:P216 ?interniert .
  ?interniert wdt:P48 ?coord2 .
  # Extract latitude and longitude for the internment location
  ?interniert p:P48/psv:P48 ?valuenode2. 
  ?valuenode2 wikibase:geoLatitude ?lat2 . 
  ?valuenode2 wikibase:geoLongitude ?lon2.
  
  # Get the destination location
  ?q p:P1198/pq:P29 ?dest .
  ?dest wdt:P48 ?coord3 .
  # Extract latitude and longitude for the destination
  ?dest p:P48/psv:P48 ?valuenode3. 
  ?valuenode3 wikibase:geoLatitude ?lat3 . 
  ?valuenode3 wikibase:geoLongitude ?lon3.
  
  # Calculate distances between points
  BIND(geof:distance(?coord1, ?coord2) AS ?dist).
  BIND(geof:distance(?coord2, ?coordD) AS ?dist2).
  
  # Create layer values based on distances (possibly for visualization)
  BIND(floor(?dist/10) AS ?layer).
  BIND(floor(?dist2/10) AS ?layer).
  
  # Create a LINESTRING connecting all three points
  BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2), ',', STR(?lon3), ' ', STR(?lat3), ')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line)
}