]> Pierre Choffet | Git repositories - wdef_tools.git/commitdiff
Improve dates management
authorPierre Choffet <peuc@wanadoo.fr>
Fri, 20 Mar 2026 04:01:44 +0000 (00:01 -0400)
committerPierre Choffet <peuc@wanadoo.fr>
Fri, 20 Mar 2026 04:01:44 +0000 (00:01 -0400)
xslts/merge_rdf.xslt

index 4297046ba2f15078786440526e9127156c688ae7..94a4b769caaaba3ff1f9e0d84e35219f0b2b62f0 100644 (file)
                                                                        <xsl:value-of select="substring(wdef:time, 2, 10)" />
                                                                </xsl:when>
                                                                <xsl:otherwise>
-                                                                       <xsl:message terminate="yes">Can only deal with precision between 9 and 11</xsl:message>
+                                                                       <xsl:message terminate="yes">
+                                                                               <xsl:value-of select="$rdf-path" />
+                                                                               <xsl:text>-</xsl:text>
+                                                                               <xsl:value-of select="$PID" />
+                                                                               <xsl:text>: can only deal with precision between 9 and 11</xsl:text>
+                                                                       </xsl:message>
                                                                </xsl:otherwise>
                                                        </xsl:choose>
                                                </xsl:variable>
                                                        <xsl:when test="$wd-time-at-least-precise = 'yes' and $wd-time-compatible = 'yes'">
                                                                <xsl:text>yes</xsl:text>
                                                        </xsl:when>
-                                                       <xsl:otherwise>
-                                                               <xsl:if test="$wd-time-at-least-precise = 'no' or $wd-time-compatible = 'no'">
-                                                                       <xsl:message terminate="yes">WD has time data but incompatible or less precise. We cannot deal with that for now.</xsl:message>
-                                                               </xsl:if>
+                                                       <xsl:when test="$wd-time-at-least-precise = 'no' and $wd-time-compatible = 'yes'">
                                                                <xsl:text>no</xsl:text>
+                                                               <xsl:message terminate="no">
+                                                                       <xsl:value-of select="$rdf-path" />
+                                                                       <xsl:text>-</xsl:text>
+                                                                       <xsl:value-of select="$PID" />
+                                                                       <xsl:text>: WD has a compatible but less precise date. Since we don't delete data in Wikidata, both values will exist in Wikidata.</xsl:text>
+                                                               </xsl:message>
+                                                       </xsl:when>
+                                                       <!-- $wd-time-compatible = 'no' -->
+                                                       <xsl:otherwise>
+                                                               <xsl:text>yes</xsl:text>
+                                                               <xsl:message terminate="no">
+                                                                       <xsl:value-of select="$rdf-path" />
+                                                                       <xsl:text>-</xsl:text>
+                                                                       <xsl:value-of select="$PID" />
+                                                                       <xsl:text>: WD has incompatible data. Since we don't delete data in Wikidata, our value will not be imported.</xsl:text>
+                                                               </xsl:message>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:otherwise>