User talk:Wolfgang Fahl: Difference between revisions
Jump to navigation
Jump to search
Olaf Simons (talk | contribs) (Created page with "== SPARQL Suche == * [https://database.factgrid.de/query/index.html#%23defaultView%3AMap%7B%22hide%22%3A%5B%22%3Fline%22%5D%7D%0ASELECT%20%2a%20WHERE%20%7B%0A%20%20%3Fq%20wdt%3AP2%20wd%3AQ995329%20.%0A%20%20%3Fq%20wdt%3AP1198%20%3FUmsiedler%20.%0A%20%20%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP95%20%3Fwoher%20.%0A%20%20%3Fwoher%20wdt%3AP48%20%3Fcoord1%20.%0A%20%20%3Fwoher%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode1.%20%3Fvaluenode1%20wikibase%3AgeoLatitude%20%3Flat1%20.%20%3Fvaluenod...") |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* [https://database.factgrid.de/query/index.html#%23defaultView%3AMap%7B%22hide%22%3A%5B%22%3Fline%22%5D%7D%0ASELECT%20%2a%20WHERE%20%7B%0A%20%20%3Fq%20wdt%3AP2%20wd%3AQ995329%20.%0A%20%20%3Fq%20wdt%3AP1198%20%3FUmsiedler%20.%0A%20%20%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP95%20%3Fwoher%20.%0A%20%20%3Fwoher%20wdt%3AP48%20%3Fcoord1%20.%0A%20%20%3Fwoher%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode1.%20%3Fvaluenode1%20wikibase%3AgeoLatitude%20%3Flat1%20.%20%3Fvaluenode1%20wikibase%3AgeoLongitude%20%3Flon1.%0A%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP216%20%3Finterniert%20.%0A%20%20%3Finterniert%20wdt%3AP48%20%3Fcoord2%20.%0A%20%20%3Finterniert%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode2.%20%3Fvaluenode2%20wikibase%3AgeoLatitude%20%3Flat2%20.%20%3Fvaluenode2%20wikibase%3AgeoLongitude%20%3Flon2.%0A%20%20%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP29%20%3Fdest%20.%0A%20%20%3Fdest%20wdt%3AP48%20%3Fcoord3%20.%0A%20%20%3Fdest%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode3.%20%3Fvaluenode3%20wikibase%3AgeoLatitude%20%3Flat3%20.%20%3Fvaluenode3%20wikibase%3AgeoLongitude%20%3Flon3.%0A%20%20BIND%28geof%3Adistance%28%3Fcoord1%2C%20%3Fcoord2%29%20AS%20%3Fdist%29.%0A%20%20BIND%28geof%3Adistance%28%3Fcoord2%2C%20%3FcoordD%29%20AS%20%3Fdist2%29.%0A%20%20BIND%28floor%28%3Fdist%2F10%29%20AS%20%3Flayer%29.%0A%20%20BIND%28floor%28%3Fdist2%2F10%29%20AS%20%3Flayer%29.%0A%20%20BIND%28CONCAT%28%27LINESTRING%20%28%27%2C%20STR%28%3Flon1%29%2C%20%27%20%27%2C%20STR%28%3Flat1%29%2C%20%27%2C%27%2C%20STR%28%3Flon2%29%2C%20%27%20%27%2C%20STR%28%3Flat2%29%2C%20%27%2C%27%2C%20STR%28%3Flon3%29%2C%20%27%20%27%2C%20STR%28%3Flat3%29%2C%20%27%29%27%29%20AS%20%3Fstr%29%20.%0A%20%20BIND%28STRDT%28%3Fstr%2C%20geo%3AwktLiteral%29%20AS%20%3Fline%29%0A%7D Personen, die von der VoMi umgesiedelt werden] | * [https://database.factgrid.de/query/index.html#%23defaultView%3AMap%7B%22hide%22%3A%5B%22%3Fline%22%5D%7D%0ASELECT%20%2a%20WHERE%20%7B%0A%20%20%3Fq%20wdt%3AP2%20wd%3AQ995329%20.%0A%20%20%3Fq%20wdt%3AP1198%20%3FUmsiedler%20.%0A%20%20%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP95%20%3Fwoher%20.%0A%20%20%3Fwoher%20wdt%3AP48%20%3Fcoord1%20.%0A%20%20%3Fwoher%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode1.%20%3Fvaluenode1%20wikibase%3AgeoLatitude%20%3Flat1%20.%20%3Fvaluenode1%20wikibase%3AgeoLongitude%20%3Flon1.%0A%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP216%20%3Finterniert%20.%0A%20%20%3Finterniert%20wdt%3AP48%20%3Fcoord2%20.%0A%20%20%3Finterniert%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode2.%20%3Fvaluenode2%20wikibase%3AgeoLatitude%20%3Flat2%20.%20%3Fvaluenode2%20wikibase%3AgeoLongitude%20%3Flon2.%0A%20%20%0A%20%20%3Fq%20p%3AP1198%2Fpq%3AP29%20%3Fdest%20.%0A%20%20%3Fdest%20wdt%3AP48%20%3Fcoord3%20.%0A%20%20%3Fdest%20p%3AP48%2Fpsv%3AP48%20%3Fvaluenode3.%20%3Fvaluenode3%20wikibase%3AgeoLatitude%20%3Flat3%20.%20%3Fvaluenode3%20wikibase%3AgeoLongitude%20%3Flon3.%0A%20%20BIND%28geof%3Adistance%28%3Fcoord1%2C%20%3Fcoord2%29%20AS%20%3Fdist%29.%0A%20%20BIND%28geof%3Adistance%28%3Fcoord2%2C%20%3FcoordD%29%20AS%20%3Fdist2%29.%0A%20%20BIND%28floor%28%3Fdist%2F10%29%20AS%20%3Flayer%29.%0A%20%20BIND%28floor%28%3Fdist2%2F10%29%20AS%20%3Flayer%29.%0A%20%20BIND%28CONCAT%28%27LINESTRING%20%28%27%2C%20STR%28%3Flon1%29%2C%20%27%20%27%2C%20STR%28%3Flat1%29%2C%20%27%2C%27%2C%20STR%28%3Flon2%29%2C%20%27%20%27%2C%20STR%28%3Flat2%29%2C%20%27%2C%27%2C%20STR%28%3Flon3%29%2C%20%27%20%27%2C%20STR%28%3Flat3%29%2C%20%27%29%27%29%20AS%20%3Fstr%29%20.%0A%20%20BIND%28STRDT%28%3Fstr%2C%20geo%3AwktLiteral%29%20AS%20%3Fline%29%0A%7D Personen, die von der VoMi umgesiedelt werden] | ||
== claude AI == | |||
<source lang='sparql'> | |||
#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 == | |||
<pre> | |||
#defaultView:Map{"hide":["?line"]} | |||
SELECT ?q ?Umsiedler ?woher ?interniert ?dest ?line ?color 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. | |||
# 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) | |||
# Assign color based on internment camp | |||
# This is a simple example; you may need to adjust based on your specific camps | |||
BIND( | |||
CASE | |||
WHEN ?interniert = wd:Q12345 THEN "rgb(255,0,0)" # Red for camp 1 | |||
WHEN ?interniert = wd:Q67890 THEN "rgb(0,255,0)" # Green for camp 2 | |||
WHEN ?interniert = wd:Q11111 THEN "rgb(0,0,255)" # Blue for camp 3 | |||
ELSE "rgb(128,128,128)" # Gray for unknown camps | |||
END AS ?color | |||
) | |||
} | |||
</pre> | |||
https://ngdemo.bitplan.com/colormap |
Latest revision as of 13:19, 18 September 2024
SPARQL Suche
claude AI
<source lang='sparql'>
- 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 ?q ?Umsiedler ?woher ?interniert ?dest ?line ?color 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. # 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) # Assign color based on internment camp # This is a simple example; you may need to adjust based on your specific camps BIND( CASE WHEN ?interniert = wd:Q12345 THEN "rgb(255,0,0)" # Red for camp 1 WHEN ?interniert = wd:Q67890 THEN "rgb(0,255,0)" # Green for camp 2 WHEN ?interniert = wd:Q11111 THEN "rgb(0,0,255)" # Blue for camp 3 ELSE "rgb(128,128,128)" # Gray for unknown camps END AS ?color ) }