Talk:Semantic Maps

From Mapping on MediaWiki
Jump to: navigation, search
Crystal Clear app error.png

Discussion page moved!
Use the new one on semantic-mediawiki.org instead!

Contents

Thread titleRepliesLast modified
distance query: buggy behavior in SM 1.0.5 (& 1.1a)223:18, May 14, 2012
Mapping issues with 1.19 Upgrade020:41, May 9, 2012
Display All Coords On A Map103:20, March 18, 2012
Coordinates not returned by query117:15, February 10, 2012
The map simply doesn't load. Latest SMW extensions. Please help..112:52, January 27, 2012
Maps with format=openlayers don't work012:42, January 26, 2012
Compound Queries123:59, November 29, 2011
Mediawiki:common.js and Semantic maps022:57, October 6, 2011
reader to RSS my feed112:39, September 25, 2011
Querying on a Semantic Forms multiple instance template112:33, September 25, 2011
Roadmap for turning Semantic Mediawiki into a full Semantic GIS210:42, September 8, 2011
Localisation query120:39, August 13, 2011
Map won't show220:25, July 27, 2011
Distance Query issue123:08, July 22, 2011
BUG: Distance Query on PostGreSQL113:33, July 12, 2011
Setting centre in query with format=openlayers116:08, May 27, 2011
Uncaught ReferenceError: addMapsOnloadHook is not defined423:48, May 23, 2011
Specifying size for infoWindow101:01, April 9, 2011
Google maps marker limit216:50, March 21, 2011
G_NORMAL_MAP307:53, March 10, 2011
First page
First page
Last page
Last page

distance query: buggy behavior in SM 1.0.5 (& 1.1a)

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).

16:18, March 21, 2012

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]

Mtyeh41117:02, April 10, 2012

This is a know issue, will be fixed in the next release. In fact, I just pushed the code that fixes this :)

Jeroen De Dauw23:18, May 14, 2012
 
 

Mapping issues with 1.19 Upgrade

#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.

Coffeehound20:41, May 9, 2012

Display All Coords On A Map

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!

Coffeehound13:50, March 17, 2012

Don't know how, but solved my own problem --- kinda.

Coffeehound03:20, March 18, 2012
 

Coordinates not returned by query

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

Elenius20:29, February 1, 2012

Your query is not shwoing. Can you link to where this is happening? Also, do you get the coordinates when you display them in a table (ie format=table)?

Jeroen De Dauw17:15, February 10, 2012
 

The map simply doesn't load. Latest SMW extensions. Please help..

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

222.79.108.13506:06, January 24, 2012

The maps loads fine for me. Is it still not loading for you? If so, what browser are you using?

Jeroen De Dauw12:52, January 27, 2012
 

Maps with format=openlayers don't work

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.

Steelcat12:42, January 26, 2012

Compound Queries

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...

Efilipe01:57, November 14, 2011

Try using a more recent version of the extension, I no longer support 0.7.x.

Jeroen De Dauw23:59, November 29, 2011
 

Mediawiki:common.js and Semantic maps

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

Ikarios23:24, October 2, 2011

reader to RSS my feed

Yes there should realize the reader to RSS my feed to RSS commentary, quite simply

91.207.8.6202:41, September 14, 2011

What?

Jeroen De Dauw12:39, September 25, 2011
 

Querying on a Semantic Forms multiple instance template

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.

67.171.96.14611:44, August 24, 2011

Are you sure the "Has coordinates" property is of type goegraphic coordinates? Also, what versions of SMW and Semantic Maps are you using?

Jeroen De Dauw12:33, September 25, 2011
 

Roadmap for turning Semantic Mediawiki into a full Semantic GIS

Edited by another user.
Last edit: 17:20, September 7, 2011

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)
Pierre Racine14:28, September 7, 2011
Edited by another user.
Last edit: 10:41, September 8, 2011

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

Gu16:46, September 7, 2011
 

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

ThomasG10:42, September 8, 2011
 

Localisation query

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?

Lloffiwr16:56, August 11, 2011

It is a page name yes :)

Jeroen De Dauw20:39, August 13, 2011
 

Map won't show

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)

Albert23:07, July 21, 2011

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.

Gwsuperfan04:02, July 22, 2011

Thank you Gwsuperfan, Sorry for the late response but your advised helped a lot, thanks! I thought that geocode was automatically applied to the Semantic Maps fields as well, but that's not the case.

Albert20:25, July 27, 2011
 
 

Distance Query issue

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.

Gwsuperfan22:39, July 21, 2011

This should still work, so is a bug. Can you link to this occurring?

Jeroen De Dauw23:08, July 22, 2011
 

BUG: Distance Query on PostGreSQL

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.

Bplewe17:29, July 6, 2011

Thanks for reporting this, I fixed it in SM 0.7.8 and SM 1.0 :)

Jeroen De Dauw13:33, July 12, 2011
 

Setting centre in query with format=openlayers

Hi.

Thanks for the great extension.

This is similar to last problem.

If I set "centre= foo, bar" in a query while using Openlayers as the map mapping service the map will be centred at "bar, foo". It works fine when I use GoogleMaps. See [1] for an example.

Query:

{{
#ask:[[Coordinates::+]]
| ?Coordinates
| format=openlayers
| centre=52.83372,13.67641 <!-- centre of shown map is 13.67641, 52.83372 -->
}}

Setup:

  • Semantic Maps (Version 0.7.6.1)
  • Semantic MediaWiki (Version 1.5.6)
Julia10:47, May 12, 2011

Sorry for the rather late reply :)

I confirmed the issue for Maps 0.7.6.1, and also found that is has been fixed on trunk, so will be correct in the (Semantic) Maps 1.0 release. I will be also fixing it for 0.7.x and make a 0.7.7 together with 1.0.

Jeroen De Dauw16:08, May 27, 2011
 

Uncaught ReferenceError: addMapsOnloadHook is not defined

I recently updated to the latest version of Semantic Forms from svn, and noticed that now whenever I edit page data with a form, and then save it, the map on the page does not load due to a javascript error - "Uncaught ReferenceError: addMapsOnloadHook is not defined". Forcing a refresh of the page fixes the problem. Below is my setup:

  • MediaWiki 1.18alpha
  • Semantic Mediawiki 1.5.5
  • Semantic Maps 0.7.6.1
  • Maps 0.7.6.1
  • Validator 0.4.6 alpha
  • Semantic Forms 2.2-alpha

Is there something I need to change about my setup?

ChrisDavis10:39, April 9, 2011

My guess is that your extension or mediawiki path is wrong; I just tested and could not reproduce your issue.

Have a look at the source of your page, it should have "extensions/Maps0.7.x/includes/mapsonload.js" somewhere. Click on the link (in firefox or chromium you can do this). Should then show a bunch of JavaScript. If it shows an error that the file is not found, my above guess is correct.

If so, have a look at $wgScriptPath in LocalSettings.php

Jeroen De Dauw21:17, April 11, 2011

Thanks for the help, and I think it's fixed now. I went from being able to duplicate this bug all the time, to not having it at all. I'm not sure exactly what fixed it, but I recently reconfigured my squid reverse proxy cache when I found that it was caching the results of api calls. Due to my settings, it may have been also caching some other older file which caused the problem.

ChrisDavis11:37, April 18, 2011
 
Edited by 0 users.
Last edit: 11:28, April 13, 2011

Hi All,

I have a similar problem. "Fatal error: Call to a member function setInputTypeHook() on a non-object in /var/www/testwiki/extensions/SemanticMaps/includes/forminputs/SM_FormInputs.php on line 76 "

  • MediaWiki 1.16.2
  • Semantic Mediawiki 1.5.6
  • Semantic Maps 0.7.6.1
  • Maps 0.7.6.1
  • Validator 0.4.6
  • Semantic Forms 2.2

Can you help me with this error?

Roberto Albrecht11:28, April 13, 2011
 

Hi Roberto, That error is caused by SemanticForms not being included before Maps in LocalSettings.php.

Sami Lavikko23:47, May 23, 2011
 

Specifying size for infoWindow

Hi,

Thanks for this terrific extension.

I'm querying multiple properties for each marker on the front-page map of my local planning project using the following code.

{{#ask: [[Category:Sites]]
|?Position
|?BuildingCount = Number of Structures
|?CampaignStatus# = Status
|?Campaigner = Campaigning organisation
|Format=map
|Height=800
}}

Private wiki, SMW 1.5.6, SM 0.7.6.1

This is fine when there are only two properties to display. However, when I add a third the text spills out of the infoWindow bubble without creating the usual scrollbar for overflow:auto.

Is there a way to specify a minimum height for the infoWindow? I would like to include images eventually, so this would be invaluable.

Thanks

Duncanjbrown22:55, April 6, 2011

You can try using the template parameter, which allows specifying the content of the info window yourself via a template. Putting everything in a div might help :)

Jeroen De Dauw01:01, April 9, 2011
 

Google maps marker limit

In a map query only the first 50 points are marked on Google as well as on Openlayer maps. Where is this limit set? Can it be changed?

Also I've to include an address at least twice in a display_points query like this in order to have a marker set. A single address centers the map correctly, but does not show a marker.

{{#display_points:{{{adres}}}; {{{adres}}} | zoom=15 | autozoom=off | nav-label, overview-map, scale }}

(private wiki, SMW 1.16, Maps 0.7.5)

Otherwise very nice addition to wiki functionality.

Tom Nagels15:51, March 17, 2011

The limit is part of the SMW ask parser function, and can be changed using the 'limit' parameter. See here.

There indeed appears to be a problem with displaying one location, I'll look into it, thanks for reporting :)

Jeroen De Dauw14:49, March 18, 2011
 

The one-location issue has been fixed in svn (as can be seen on this wiki), and will be in the next release (0.7.6), which I'm planning to create later today :)

Jeroen De Dauw16:50, March 21, 2011
 

G_NORMAL_MAP

I'm trying to show several maps using compound queries.

http://www.wikirio.com.br/Sandbox:Ipanema

You can see the error on the page. But if you edit it and leave only one query, it works fine.

Having multiple maps would be gret for my site. Anyone can help?

Thanks

186.221.145.618:36, March 7, 2011

I'm not seeing any errors actually...

Jeroen De Dauw02:16, March 8, 2011

Jeron, I think I was working on it when you visited the page: Please try again: http://www.wikirio.com.br/Sandbox:Ipanema

If you edit the page and remove only one of the compoundquery, will work again.

Hope you like the site. I'm trying to get the best from semantics.

186.221.145.601:33, March 10, 2011

Ah, I see. For some reason, the initialization JavaScript and the stuff of the first map is not getting outputted. The same issue is occurring here. I will keep this in mind for the next release of Maps.

Jeroen De Dauw07:53, March 10, 2011
 
 
 
First page
First page
Last page
Last page
Personal tools
Namespaces
Variants
Views
Actions
Navigation
Manuals
Useful lists
More awesomeness
Toolbox