lizmap / lizmap-pgmetadata-module
Jelix 模块用于 Lizmap,增加了显示使用 PgMetadata 创建的图层元数据的工具
1.0.7
2024-08-26 14:53 UTC
README
本模块是为Lizmap Web Client设计的,允许显示存储在图层数据库中的 PostgreSQL 图层元数据。
元数据必须在 PostgreSQL 数据库中按照PgMetadata QGIS 插件的设计创建。
安装
一旦 Lizmap Web Client 应用程序安装并运行,您可以安装 pgmetadata 模块
从版本 0.2.4 开始,建议使用 PHP 的包管理器 Composer 安装模块。如果您无法使用它或如果您正在使用 Lizmap 3.3 或更低版本,请使用手动方式安装模块(跳转到下面的相应部分)
使用 Composer 和 Lizmap 3.4 或更高版本自动安装
- 在
lizmap/my-packages
中,创建文件composer.json
(如果不存在),通过复制文件composer.json.dist
,然后使用 Composer 安装模块
cp -n lizmap/my-packages/composer.json.dist lizmap/my-packages/composer.json
composer require --working-dir=lizmap/my-packages "lizmap/lizmap-pgmetadata-module"
- 然后进入
lizmap/install/
并执行 Lizmap 安装脚本
如果您使用 Lizmap 3.6 或更高版本,首先执行
php configurator.php pgmetadata php configurator.php pgmetadataAdmin
然后,对于 Lizmap 3.4 和更高版本
php installer.php ./clean_vartmp.sh ./set_rights.sh
转到下一节“将元数据作为 DCAT 目录发布”。
在 Lizmap 3.3 或 3.4 中不带 Composer 的手动安装
- 从GitHub 仓库的发布页面获取最新的 ZIP 归档。
- 解压归档,并将
pgmetadata
和pgmetadataAdmin
目录复制到 Lizmap Web Client 文件夹lizmap/lizmap-modules/
中 - 编辑配置文件
lizmap/var/config/localconfig.ini.php
,并在[modules]
部分中添加
pgmetadata.access=2 pgmetadataAdmin.access=2
- 在
[simple_urlengine_entrypoints]
部分中添加
admin="jacl2db~*@classic,jacl2db_admin~*@classic,jauthdb_admin~*@classic,master_admin~*@classic,admin~*@classic,jcommunity~*@classic,pgmetadataAdmin~*@classic"
如果参数已经存在,请将 ,pgmetadataAdmin~*@classic
添加到值中。
- 如果您使用 Lizmap 3.6 或更高版本,执行
php lizmap/install/configurator.php pgmetadata php lizmap/install/configurator.php pgmetadataAdmin
- 然后执行
lizmap/install/
中的 Lizmap 安装脚本
php lizmap/install/installer.php ./lizmap/install/clean_vartmp.sh ./lizmap/install/set_rights.sh
将元数据作为 DCAT 目录发布
如果您需要将元数据目录作为 RDF 目录发布,例如由第三方元数据平台(如 Ckan)收集,您需要向托管元数据的 PostgreSQL 数据库声明所需的凭证。
为此,进入 Lizmap 的管理界面,点击 pgmetadata 菜单项,您可以指定这些凭证。
然后,您将能够访问以下 URL
- 完整的 RDF 目录,URL 形式如:https://[YOUR_LIZMAP_URL]/index.php/pgmetadata/dcat/
- 一个数据集记录通过 UUID 标识符,URL 形式为:https://[YOUR_LIZMAP_URL]/index.php/pgmetadata/dcat/?id=76853e57-387e-4b8d-9ee8-f176e11cd9ce
- 筛选包含特定 关键字 的数据集:https://[YOUR_LIZMAP_URL]/index.php/pgmetadata/dcat/?q=akeyword
创建并返回的 XML 将如下所示
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dct="http://purl.org/dc/terms/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:schema="http://schema.org/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <dcat:Catalog rdf:about="https://lizmap.com"> <dct:description>PgMetadata DCAT RDF catalog</dct:description> <dct:language>fr</dct:language> <dct:title>PgMetadata</dct:title> <dcat:dataset> <dcat:Dataset rdf:about="http://lizmap.localhost/index.php/pgmetadata/dcat/?id=76853e57-387e-4b8d-9ee8-f176e11cd9ce"> <dct:identifier>76853e57-387e-4b8d-9ee8-f176e11cd9ce</dct:identifier> <dct:title>Test title</dct:title> <dct:description>Test abstract.</dct:description> <dct:language>en</dct:language> <dct:license>Licence Ouverte Version 2.1</dct:license> <dct:rights>Open</dct:rights> <dct:accrualPeriodicity>Yearly</dct:accrualPeriodicity> <dct:spatial>{"type":"Polygon","coordinates":[[[3.854,43.5786],[3.854,43.622],[3.897,43.622],[3.897,43.5786],[3.854,43.5786]]]}</dct:spatial> <dct:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-12-31T09:16:16.980258</dct:created> <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-12-31T09:16:16.980258</dct:issued> <dct:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2020-12-31T09:16:16.980258</dct:modified> <dcat:contactPoint> <vcard:Organization> <vcard:fn>Jane Doe - Acme (GIS)</vcard:fn> <vcard:hasEmail rdf:resource="jane.doe@acme.gis">jane.doe@acme.gis</vcard:hasEmail> </vcard:Organization> </dcat:contactPoint> <dct:creator> <foaf:Organization> <foaf:name>Jane Doe - Acme (GIS)</foaf:name> <foaf:mbox>jane.doe@acme.gis</foaf:mbox> </foaf:Organization> </dct:creator> <dct:publisher> <foaf:Organization> <foaf:name>Bob Robert - Corp (Spatial div)</foaf:name> <foaf:mbox>bob.bob@corp.spa</foaf:mbox> </foaf:Organization> </dct:publisher> <dcat:distribution> <dcat:Distribution> <dct:title>test link</dct:title> <dct:description>Link description</dct:description> <dcat:downloadURL>https://metadata.is.good</dcat:downloadURL> <dcat:mediaType>application/pdf</dcat:mediaType> <dct:format>a file</dct:format> <dct:bytesize>590</dct:bytesize> </dcat:Distribution> </dcat:distribution> <dcat:keyword>tag_one</dcat:keyword> <dcat:keyword>tag_two</dcat:keyword> <dcat:theme>test theme</dcat:theme> <dcat:theme>New test theme</dcat:theme> </dcat:Dataset> </dcat:dataset> </dcat:Catalog> </rdf:RDF>
贡献指南
对于 PHP,项目使用 PHP-CS-Fixer。对于 JavaScript,它使用 ESLint。使用 npm install
安装。
Makefile 中有运行它们的命令。
获取帮助
- 向 Lizmap 邮件列表发送电子邮件至 https://lists.osgeo.org/pipermail/lizmap/
- 加入我们,在 https://libera.chat 的 #lizmap
- 在https://github.com/3liz/lizmap-adresse-module/issues上创建一个Github工单
- 通过3liz提供商业支持,联系我们