<div dir="ltr">Hi Tom,<div><br></div><div>I still have pycsw 1.9 so I haven't seen the thing with -y in pycsw-admin.py. My fault... I'll upgrade!<div>Adding this to the docs is definitely a good idea.</div><div><br></div><div>Thanks a lot,</div><div>Eva</div><div><br><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-07-27 18:36 GMT+02:00 Tom Kralidis <span dir="ltr"><<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On Mon, 27 Jul 2015, Eva Jelínková wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Date: Mon, 27 Jul 2015 17:34:36 +0200<br>
From: Eva Jelínková <<a href="mailto:evka.jelinkova@gmail.com" target="_blank">evka.jelinkova@gmail.com</a>><br>
To: Tom Kralidis <<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>><br>
Cc: <a href="mailto:pycsw-devel@lists.osgeo.org" target="_blank">pycsw-devel@lists.osgeo.org</a><br>
Subject: Re: [pycsw-devel] metadata editor<br>
<br>
Hello Tom,<br>
<br>
thank you very much for your response. We are still at the stage of<br>
research and testing.<br>
<br>
We are going to store metadata XMLs in pycsw - it's great that user can<br>
access it easily via QGIS. We've already tested harvesting to CKAN which we<br>
plan to use as graphical user interface for browsing and searching.<br>
<br>
Our workflow is going to be probably like this:<br>
<br>
web form => MCF file => pygeometa => XML => pycsw => CKAN<br>
<br>
Thanks for Flask recommendation!<br>
<br>
I was thinking also about using CKAN as form for creating/editing records<br>
but I found it difficult to get the edited record back to pycsw or create<br>
XML straight from CKAN...<br>
<br>
<br>
There is one thing in pycsw that I haven't got yet. Maybe you can help me.<br>
I have some testing XMLs that I load to pycsw via pycsw-admin.py:<br>
<br>
python /path/to/pycsw-admin.py -c load_records -f /path/to/pycsw.cfg -p<br>
/path/to/xml -r<br>
<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When I update some of that XMLs it is impossible to just reload it because<br>
"Key (identifier)=(xy) already exists". So the easiest way for me (for now<br>
- I have just a few records) is delete all records in DB and than load them<br>
again.<br>
</blockquote>
<br>
<br>
We addressed this in <a href="https://github.com/geopython/pycsw/issues/290" rel="noreferrer" target="_blank">https://github.com/geopython/pycsw/issues/290</a>.  Adding a -y flag to pycsw-admin.py will force update (do a pycsw-admin.py -h to<br>
see examples).  I wonder whether we should add this to the docs (<a href="http://docs.pycsw.org/en/latest/administration.html#loading-records" rel="noreferrer" target="_blank">http://docs.pycsw.org/en/latest/administration.html#loading-records</a>) as well?<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I think the right way would be to use transactions (update) instead of<br>
deleting all the records all the time...<br>
Unfortunately there is not so much information about transactions in<br>
documentation (when I will be able to use transactions correctly I could<br>
add there some notes for people who are novices as I am :D ).<br>
For full update I added tags csw:Transaction and csw:Update to my metadata<br>
XML:<br>
<br>
<csw:Transaction ...><br>
<csw:Update><br>
<gmd:MD_Metadata ...><br>
...<br>
</gmd:MD_Metadata><br>
</csw:Update><br>
</csw:Transaction><br>
<br>
and posted it by pycsw-admin.py:<br>
<br>
python /path/to/pycsw-admin.py -c post_xml -x /path/to/xml/sample.xml -u<br>
<a href="http://myhost/cgi-bin/csw.py" rel="noreferrer" target="_blank">http://myhost/cgi-bin/csw.py</a><br>
<br>
It worked :) but my question is - is there any possibility to do the full<br>
update for whole directory full of XMLs (all with update tags)? According<br>
to the information I found here [1], full update should be able to update<br>
records in DB and also add new ones. I think that maybe we could create all<br>
XML files as update XMLs and than every time we run post_xml we would have<br>
all records updated. Would it be possible or am I on the completely wrong<br>
way?<br>
</blockquote>
<br>
The underlying functionality of pycsw-admin.py is all scriptable as well, so<br>
you could write a script create a csw:Transaction XML as you describe with<br>
each XML file in a directory written inline.  Having said this, pycsw-admin.py<br>
provides these as convenience functions if you are able to run on the command<br>
line, and the -y flag will force the update.<br>
<br>
Hope this helps.<br>
<br>
..Tom<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks for any advice,<br>
Eva Jelinkova<br>
<br>
[1]<br>
<a href="http://geopython.github.io/pycsw-workshop/docs/advanced/transactions.html" rel="noreferrer" target="_blank">http://geopython.github.io/pycsw-workshop/docs/advanced/transactions.html</a><br>
<br>
<br>
<br>
2015-07-27 14:41 GMT+02:00 Tom Kralidis <<a href="mailto:tomkralidis@gmail.com" target="_blank">tomkralidis@gmail.com</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Sun, 26 Jul 2015, Eva Jelínková wrote:<br>
<br>
 Date: Sun, 26 Jul 2015 23:17:05 +0200<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Eva Jelínková <<a href="mailto:evka.jelinkova@gmail.com" target="_blank">evka.jelinkova@gmail.com</a>><br>
To: <a href="mailto:pycsw-devel@lists.osgeo.org" target="_blank">pycsw-devel@lists.osgeo.org</a><br>
Subject: [pycsw-devel] metadata editor<br>
<br>
Hi all pycsw people,<br>
<br>
we are trying to set a catalog service based on pycsw to store the<br>
information about the data and services in our company. pycsw works well<br>
<br>
</blockquote>
<br>
Great to hear this!  If you have endpoint(s), feel free to add them / have<br>
them added to our live deployments wiki page [1], which powers our live<br>
deployments map [2].<br>
<br>
 for us, it seems that the only problem is creation of metadata records...<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I<br>
have tried GIMED and EUOSME metadata editors but none is good enough for<br>
our case. We need just an easy open source web form (ideally python<br>
based).<br>
It don't have to be valid for all requirements of the INSPIRE directive.<br>
We<br>
will probably develop one but if there is any similar project you know<br>
about, just let me know, please. It would really help us.<br>
<br>
<br>
</blockquote>
There are numerous web options out there embedded in applications like<br>
GeoNode and CKAN, however at the cost of all the associated machinery.<br>
<br>
Having said this, as part of another project I'm involved in, we recently<br>
released pygeometa [3] which supports creating ISO from a simple<br>
ConfigParser<br>
file/object.  You could implement a simple Flask [4] based front end to<br>
provide a form and saving logic, which would create a pygeometa<br>
metadata object and then serialize to a metadata file as desired.  Or, even<br>
better, publish directly to pycsw :)<br>
<br>
..Tom<br>
<br>
[1] <a href="https://github.com/geopython/pycsw/wiki/Live-Deployments" rel="noreferrer" target="_blank">https://github.com/geopython/pycsw/wiki/Live-Deployments</a><br>
[2] <a href="http://pycsw.org/community/" rel="noreferrer" target="_blank">http://pycsw.org/community/</a><br>
[3] <a href="https://github.com/geopython/pygeometa" rel="noreferrer" target="_blank">https://github.com/geopython/pygeometa</a><br>
[4] <a href="http://flask.pocoo.org/" rel="noreferrer" target="_blank">http://flask.pocoo.org/</a><br>
<br>
</blockquote>
<br>
</blockquote>
</blockquote></div><br></div>