Talk:Semantic Maps
Discussion page moved!
Use the new one on semantic-mediawiki.org instead!
Contents
![]() First page |
![]() Previous page |
![]() Next page |
![]() Last page |
Hello, I'm making a website which shows a map of a campus. I'm using this very cool extension to generate that map automatically using the coordinates on each building's page. Currently on the page for each building I show a small map in the infobox with a market showing where that build is (just using the standard Maps extension). If possible, I'd like to make it so that map also shows points for the other buildings so that people can click on a nearby building for info on it. But I need the building the current page discusses to stand out, maybe by using a different marker. Is there any way to do this? Thanks.
Yes, you can do this. I know someone has a site that's a perfect example for this but don't remember what it's called... You could try asking on the SMW user list I guess.
Either way, you need the staticlocations parameter, which allows you to set the location specified on the page as a marker and associate some other icon with it.
I noticed on the documentation page for Geocodingthat several of the examples where the location is text based are now showing the error: "Fatal error: Parameter location must be a valid location."
Has something changed?
To begin with: thanks for the developers for their great work!
[edit] Problem
I am trying to get displayed geographic data stored in the SIOs. At http://scratchpad.referata.com/wiki/Depost I have put 2 textual records that are then passed to the http://scratchpad.referata.com/wiki/Template:Citatio template as to build SIOs. The crucial elements there are fields:
- "Cit geo" defined as {{{8}}}, and
- "Cit coordinates" defined as {{#geocode:{{{8}}} }}.
There are 3 templates responsible for displaying data on my page:
- "Art citation pie" (http://scratchpad.referata.com/wiki/Template:Art_Citation_pie) that displays distributional data on "Cit genus" property of SIO;
- "Art citation timeline" that displays timeline of "Cit start" and "Cit end" properties, and finally
- "Art citation map" (http://scratchpad.referata.com/wiki/Template:Art_Citation_map).
This is the last one that I found incapable to display the geographic data: it does not work for me neither on the page in question nor on the Special:Ask. The only one format that seems to work for me now is #display_points (i. when it is geographic coordinates' array that is passed to the function) which is, however, too simple for my purposes as I wish to dynamically display other SIO properties as well as its geographic location. I tried to change 'Has type' value for both 'Cit geo' and 'Cit coordinates' (http://scratchpad.referata.com/wiki/Property:Cit_coordinates). That however results in a PHP error (in scratchpad and in my own installation a well): "Call to undefined method SMGeoCoordsValue::getDBkeys() in /home/yaron57/public_html/w/extensions/SemanticInternalObjects/SemanticInternalObjects_body.php on line 173". My question is, then, is it a SIO bug or my #ask queries are not formed as they should? Has anyone had similar problems? Thank you in advance for any help! Nova
Hi - it looks like the issue (or at least one issue) is that you should have defined this property as being of type Geographic coordinates, instead of Text.
For some reason I am not able to display markers loaded from KML. Besides that everything works like a charm. Does Google/GE need to be able to access the file on the server (it's an internal wiki for work) ?
My logs are not showing up any errors. Any tips on how to fault trace the issue?
I have the same problem on a live site. no kml files are showing. I copied and pasted the examples from this wiki and they don't work on my site either. perhaps there is a missing param or localsettings call or simply gkml is not implemented for the public release? it is kind of hard to figure out without documentation. media wiki 1.9 smaps 1.0.5
I copied and pasted this from the kml example page. It does not render any kml on my site.
the kml valadates on maps.google.com as do all of my kml files. none render however.
I posted the previous comment. the example renders here. Not on my site.
This site is currently using Maps version 2.0 alpha, which has KML support improvements. This is still an early development version, so not really suited for production usage if you don't know what's going on. However, I will try to release a new dev version of Semantic Bundle including Maps soonish
Weird behavior. Semantic Map shows on Edit preview but not on Save here. Stalls-out on "Loading map". Also, "Maps" are working on other pages on site but not on same page as Query for SM. i.e. when a Map is on same page as SM query, both stall out on Save. Also, Example of Compound Query on this referata site does the same thing but other examples of SM queries display???
I use Firefox but have tested with IE and Chrome and get same behavior.
MediaWiki 1.18.0,PHP 5.2.17 (cgi-fcgi),MySQL 5.0.92-log,SMW 1.7.1,Semantic Bundle 20120308 with Maps 1.0.5 and SM 1.0.5
I just fixed this issue, so the next release should help you out :) Thanks for reporting!
Thanks Jeroen, I'm assuming it was unique to my configuration but leaves me wondering if I was the only one not able to load the compound query example here on referata?
In any case, any ETA on the next release of SM? Cheers!
I was querying by distance using a template. After updating to 1.0.5 it broke (updating to 1.1a made no difference)
Even outside a template, distance querying was still an issue. Example:
{{#ask: [[Coordinates:: <some-known-coordinates> (0.05 miles)]] | format=map }}
A debug of the above query shows that the generated wiki query was:
[[Coordinates::<some-known-coordinates>]]
Also, in case it helps, the coordinates use float notation. The generated wiki query successfully converted them to DMS, but did not include the distance. It really didn't matter what notation I used for the input coordinates; the results were the same.
FYI, on this wiki I have been UNABLE to successfully preview the behavior (format=debug throws exception).
Revisited this topic today: I thought that the cause was that the wiki query was not being generated correctly since 'format=debug' did not print it correctly. However, the underlying issue seems to be that a map (at least a SMW query map) cannot be displayed on the same page as a Form Input map (as would happen from within Special:RunQuery).
In my example, I am asking for coordinates to be input from query form. The query form's template is running a distance query and displaying the map. When the response is returned, the form input map at the bottom displays fine; however, the expected map containing the distance query is not. Browser inspection shows that there is a ReferenceError to 'mwmaps' (possibly resource namespace is not resolving).
I have confirmed buggy behavior on Referata scratchpad wiki and mimicked on: [1]
#ask and compound queries not working See: http://offgridops.org/foreclosurepedia/index.php/Template:Main_Page_REO
Map not displaying in Semantic Forms Simply use Foo for the Entry Name See: http://offgridops.org/foreclosurepedia/index.php/Form:REO_Property_Inventory
Spoke with JDeDauw on IRC today about it. Was advised he had another email on it. Would appreciate being advised here on how to fix the issues.
Side note: All previously entered maps ( http://offgridops.org/foreclosurepedia/index.php/1866787789 ) work as does most simple displays of map services.
Thanx.
I have a form which collects information on properties I work on. I would like to display all the properties on a single map with simple markers. Currently, it doesn't work http://offgridops.org/foreclosurepedia/index.php/Test Could someone please show me what I would need to change here, thanx! I don't know if it is a Property deal; perhaps my Form/Template is messed up; or perhaps I am calling the #Ask wrong? I will display whatever info is necessary to get the help I need!
The Form http://offgridops.org/foreclosurepedia/index.php/Form:REO_Property_Inventory
The Template http://offgridops.org/foreclosurepedia/index.php/Template:REO_Property_Inventory
List of Category with all Coordinate data http://offgridops.org/foreclosurepedia/index.php/Category:REO_Property_Inventory
I am a novice and really just cut and paste. I LOVE the extension y'all built BTW!
I have a category Place with a property Coordinate. I have a place individual with coordinates filled in. They show up in the info box for the individual. However, when I do a query like
I get nothing in the coordinate column. Not sure if this is a SM problem, but I can query other stuff on the wiki correctly.
I'd appreciate any help. This plugin looks very cool.
Daniel
Hi Jeroen, first of all thanks for all your good work.
I just uploaded mediawiki and SMW extensions, so there isn't any content on the website.
I created a test page in order to see if the map and Semantic map extensions work but the map just got stucked and doesn't load.
All the website will be involving around the maps, so it is important to get that working first.
Here is the link http://www.bestofxiamen.com/wiki/index.php?title=Testmap
Could you have a quick expert look at see what could be the problem? Thanks a lot
After upgrade to Semantic Maps ver. 1.0.5, compound_query with format=openlayers not work. The map doesn't load. Semantic Maps ver. 1.0.4 works fine.
Im having an error when I use Compound Query with Semantic Maps. If I use only one compound query works fine. Doesnt work when I use two time in the same page: http://www.wikirio.com.br/Sandbox:Ipanema2
Yaron thinks its something on Semantic Maps and not on Compound Queries. Can you guys help? See what Yaron sai in the URL:
http://www.mediawiki.org/wiki/Extension_talk:Semantic_Compound_Queries
Thanks...
I plan to use the Mootools framework in order to add a more intuitive interface in my wiki. http://www.mediawiki.org/wiki/Mootools
So I include Mootools code inside Mediawiki:common.js. http://bougna.referata.com/wiki/MediaWiki:Common.js
The googlemaps v2 service works in a semantic ask query on my website and I can use content slider from Mootools in the same time. http://bougna.referata.com/wiki/Googlemaps2_with_mootools
When I change the service to googlemaps v3, ask query doesn't work anymore http://bougna.referata.com/wiki/Googlemaps3_with_mootools
Even if I only include the Mootools core (no slider code in MediaWiki:Common.js) the googlemaps v3 service displays nothing...
Thanks for your answer
Hi, everyone. I am trying to query up a map that has a multiple instance template containing certain properties. This works fine using a regular ask query displaying a table, but not for displaying a map. For example, if I wanted to access items Store that contain at least one instance of OpeningTimes where OpeningTimesHour is greater than 9 (where Store looks like this):
{{Store
|StoreType=Grocery Store
|StoreSize=10,000 sq ft
}}
{{OpeningTimes
|OpeningTimesDay=Weekdays
|OpeningTimesHour=8
}}
{{OpeningTimes
|OpeningTimesDay=Sundays
|OpeningTimesHour=10
}}
I'd expect these two to work the same:
{{#ask:[[OpeningTimes.Store::!+]][[OpeningTimes.OpeningTimesHour::>9]]
| ?Has coordinates
| format=table
}}
{{#ask:[[OpeningTimes.Store::!+]][[OpeningTimes.OpeningTimesHour::>9]]
| ?Has coordinates
| format=map
}}
...but only the first one works. Any ideas how I can get the same results using a map? Thanks.
Semantic Mediawiki is an amazing web database system. Here is a list of enhancement we would need to make of Semantic Mediawiki an amazing GIS (web, web 2.0, endlessly configurable, history, other wonderful features??) as well.
- Link to PostGIS - Add read/write support for all the PostGIS types of geometry (point, line, polygon, etc..) as new SMW data types. Should there be only one type encompassing all the others (“postgis geometry” like the “geometry” type in PostGIS) or as many types as there is types of geometries (“postgis point”,”postgis line”, etc…)? Should the geometry type be stored a ewkt or as hexewkb in a wiki page? Geometries could also be stored in the MySQL spatial extension.)
- Storage – Geographic information could be stored in three ways:
- One row per page: This is already possible in SMW.
- All the rows of a layer in one page. This is already possible in SMW with the SIO extension (one row = one SIO object).
- Virtual tables - Optionally, all the rows as a virtual object making the link between a layer stored as a table in the database and a wiki page. This is useful to avoid storing, say, 25 million geographic features, as 25 M pages or as 25M SIO in one page. This virtual table object would internally create SMW relations like the SIO object do without actually needing a named template to be added in the page for each row. This would very much ack like a RSS feed reader linking to internal (and eventually or external) data with the difference that it would allow editiong as well. These virtual table objects could be created in a new namespace and feeded through import of shapefiles with the data transfer extension. They could be inserted in a page (to create relations) as a special tag. SMW would then see every row as a set of relation like it does with SIO. Semantic Form should allow editing the rows of those objects and #ask queries should allow querying them. This new type of object is actually independent from the new spatial support. It is just a general mechanism to be able to make relations with virtual (internal or external) objects stored in the Mediawiki data base or as remote data feed. Remote data feed could be edited only through a protocol similar to WFS.
- Coordinate Systems - A special standard semantic content page could store all the coordinate systems necessary to the system being build. There could be a special form where we can drop the .prj or any text representation of a coordinate system (see http://spatialreference.org). Every geometry should have an implicit "Has Coordinate System" property.
- Display – Add display of complex ewkt (or hexewkt) geometries over the Google map of Mediawiki Map. Add the possibility to display all the resulting rows of a #ask query in a single map. How should symbology be managed?
- Import/Export – Import could be done (as a CSV ewkt or hexewkb strings) via the Data Transfer extension. This implies that the users have a way to convert shapefiles geometries into ewkt or hexewkb (PostGIS can easily do that). Data Transfert or a new extension could also support direct import (and conversion to ewkt or hexewkbx) of the OGR format.
- Edition – Add the possibility to edit a complex geometry like it is possible to do in My Google Map.
- Geoprocessing – Unary geoprocessing (implying unary operators acting on a single geometry) would be done as a set of functions (like PostGIS ST_Buffer()) working on the new PostGIS geometry type and usable in #ask template queries. Actual computation would be done internally using the PostGIS SQL API. Binary geoprocessing (implying binary operators acting on two geometries) could be done the same way as it is done in SMW (is it possible? Inference? This is the equivalent of a many to many relation).
That’s it! That’s all we need to transform SMW into a spatial database and the most functional web GIS ever! (Like SMW is the most functional web database ever!). The most fundamentals pieces are "Link to PostGIS", "Coordinate Systems", "Display of complex geometry" and "Edition". "Storage" is already possible in two forms. "Import/export" would already be possible as ewkt or hexewkb produced by other means, "Virtual table" is optional and "Geoprocessing" would be the cherry on the cake!
Still some obscure points:
- how to automatically assign a symbology to a geometry (based on its characteristics) when displaying it on a map. Should just it be the responsibility of the displayer (like the kml query format) or should there be a more general mechanism where symbology are stored as semantic pages and are automatically associated to geometries by some magic... A first attempt should allow modifying the pin image for example. There should be a page for this pin with a color parameter and a way to select the right pin based on some property of the object we want to display. We should then generalize the principle for lines and polygons...
- how to do binary spatial operation (like intersection) on a many to many relationship (one road intersects with many lakes and one lake intersect with many roads). I try to create an example with employes and team (one employe belong to many teams and one team gathers many employe) to see how a query recreating all the teams but attribute only relationship are generally explicit (you assign an employe to a team) whereas spatial relation are implicit (derived from a spatial relationship).
- how to deal with raster data (PostGIS 2.0 will store raster)
Sounds very interesting and should be doable. I got interested in geo-coded data a while ago and tried to build an ad-hoc system to query and display them. I did something much more basic as you describe (not PostGIS) storing geo-coded data sets with several thousand entries on one page as multi-valued properties (although in practice to fetch all the data every time from the SMW database is much too slow so the data are cached as tables in files to be read quicker as long as the cache is valid, which is no problem as my data are more or less static). The display is via an #ask query and the Exhibit query result format either from one data set or from several ones combined. It allows various different types of overlays to be added to the map and the usual data filtering via the exhibit facets/views. However, it's all very customized to deal with the large number of data points and other specific problems with the data sets I use, so all of the extensions are modified. Cheers, Gu
This project can maybe help you https://dev.opensahara.com/projects/2/wiki/IndexingSail It already uses PostGIS to deal with geo semantic and triple store. Regards. ThomasG
In the message Semanticmaps-default-kml-pagelink ("view page $1") can anyone confirm our guess on translatewiki.net that the variable $1 is a page name?
Hi All / Jeroen, I just installed Semantic Maps, Validator & Maps as mentioned on a website. Maps seems to work but I can't get Semantic maps to work with a simple query that provides a city name, or country name. I just get a white page. Any idea what might go wrong? This is the link: http://csdms.colorado.edu/wiki/Test5
Thanks, Albert.
Software: MediaWiki 1.16.5 PHP 5.3.6 (apache2handler) MySQL 5.5.12 Semantic MediaWiki (Version 1.5.6) Semantic Maps (Version 0.7.7) Validator (Version 0.4.7) Maps (Version 0.7.7)
The first parameter returned by your query needs to be a valid coordinate.
You can use the Geocode function to return a coordinate from a city/state combination in your template and set it as a semantic property using {{#set: }}. For example: {{#set: Coordinates={{#geocode: Boulder, Colorado}} }}
The property should have the type geographic coordinate.
Then you can do an {{#ask: <criteria> | ?Coordinates | format=map }} to display the results.
Not sure if this is a bug, feature, or just a behavior change:
Prior to upgrading to Maps/Semantic Maps 1.0, I had a template that contained a location query:
{{#ask: [[Location::{{{location}}} (300 mi)]] [[Location::!{{{location}}}]] }}
The idea being that on pages for place, other places within 300 miles could be displayed in a table. The reason for [[Location::!{{{location}}}]] in the query is to eliminate the current location from the results. (I know where I am, I just want to know what else is nearby).
I've worked around the issue by using other criteria, but I don't know if the behavior change was intentional or not, so I figured it was worth mentioning.
Trying to do a distance query in Semantic Maps running on PostGreSQL (I know we PG people are a thorn in the developers' sides :-) ). When the query executes, it throws a syntax error. The problem appears to be that you are tying the bounding box criteria together with "&&" and PostGreSQL wants "AND". I went into SM_AreaValueDescription.php line 149 and changed && and || to AND and OR, and it works fine. Not sure if that is a global fix, but it worked for me.
![]() First page |
![]() Previous page |
![]() Next page |
![]() Last page |




