GSA / govt-urls

Most government websites end in .gov or .mil, but many do not. This repo contains USA.gov's list of public government domains and URLs that don't end in .gov or .mil.
https://search.gov/developer/govt-urls.html
218 stars 46 forks source link

here's a breakdown of use cases for a required element ( i.e. `keyword` ) which can occur many times ( i.e. `unbounded` ). the minimum number of occurrences is 1. we're also allowing an acceptable `gco:nilReason` as an exception to the requirement rule by simply skipping them during processing. #147

Open shuvosarker22 opened 3 weeks ago

shuvosarker22 commented 3 weeks ago
          here's a breakdown of use cases for a required element ( i.e. `keyword` ) which can occur many times ( i.e. `unbounded` ). the minimum number of occurrences is 1. we're also allowing an acceptable `gco:nilReason` as an exception to the requirement rule by  simply skipping them during processing. 
<!-- use case 1 (valid) -->
<gmd:keyword gco:nilReason="missing"/>
<gmd:keyword />
<gmd:keyword>
  <gco:CharacterString>Nautical Charting</gco:CharacterString>
</gmd:keyword>  

<!-- use case 2 (valid) -->
<gmd:keyword gco:nilReason="missing"/>

<!-- use case 3 (invalid) -->
<gmd:keyword />

<!-- use case 4 (invalid) -->
<gmd:keyword gco:nilReason="missing"/>
<gmd:keyword />

<!-- use case 5 (valid) -->
<gmd:keyword>
  <gco:CharacterString>Nautical Charting</gco:CharacterString>
</gmd:keyword>  

<!-- use case 6 (valid) -->
<gmd:keyword />
<gmd:keyword>
  <gco:CharacterString>Nautical Charting</gco:CharacterString>
</gmd:keyword> 

<!-- use case 7 (invalid) -->
<gmd:keyword gco:nilReason="invalid nil reason"/>

one easy approach to this problem is to simply complain if the document doesn't have at least 1 valid keyword. anything else is invalid. however, that breaks our rule of considering gco:nilReason

<gmd:keyword>
  <gco:CharacterString>Nautical Charting</gco:CharacterString>
</gmd:keyword> 

another approach would be to check if there's at least 1 valid element or 1 element with an acceptable nilReason?

Originally posted by @rshewitt in https://github.com/GSA/data.gov/issues/4924#issuecomment-2444795773

rshewitt commented 3 weeks ago

@GSA/data-gov-dev-team delete this. i don't have permission.