We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add automated check for licenses
              Did someone carefully check the repository? It says there the data is licensed under CC BY 4.0-SA, which is not acceptable for OBO Foundry: https://github.com/Dalalghamdi/NGBO

_Originally posted by @cthoyt in https://github.com/OBOFoundry/OBOFoundry.github.io/issues/2214#issuecomment-1399241788_
            

What happened in NGBO is that the author had a different license in the metadata they submitted to the OBO Foundry than what the LICENSE file said inside their repository. Further, this wasn't carefully checked by reviewers. We should add an automated check for the future to make sure this doesn't happen again.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/obofoundry/utils.py`
Content:
```
1 """Test data integrity, beyond what's possible with the JSON schema."""
2 
3 import requests
4 import yaml
5 
6 from obofoundry.constants import ONTOLOGY_DIRECTORY
7 
8 __all__ = [
9     "get_data",
10     "query_wikidata",
11 ]
12 
13 
14 def get_data():
15     """Get ontology data."""
16     ontologies = {}
17     for path in ONTOLOGY_DIRECTORY.glob("*.md"):
18         with open(path) as file:
19             lines = [line.rstrip("\n") for line in file]
20 
21         assert lines[0] == "---"
22         idx = min(i for i, line in enumerate(lines[1:], start=1) if line == "---")
23 
24         # Load the data like it is YAML
25         data = yaml.safe_load("\n".join(lines[1:idx]))
26         data["long_description"] = "".join(lines[idx:])
27         ontologies[data["id"]] = data
28     return ontologies
29 
30 
31 #: WikiData SPARQL endpoint. See https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service#Interfacing
32 WIKIDATA_SPARQL = "https://query.wikidata.org/bigdata/namespace/wdq/sparql"
33 
34 
35 def query_wikidata(query: str):
36     """Query the Wikidata SPARQL endpoint and return JSON."""
37     headers = {"User-Agent": "obofoundry/1.0 (https://obofoundry.org)"}
38     res = requests.get(
39         WIKIDATA_SPARQL, params={"query": query, "format": "json"}, headers=headers
40     )
41     res.raise_for_status()
42     res_json = res.json()
43     return res_json["results"]["bindings"]
44
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/obofoundry/utils.py b/src/obofoundry/utils.py
--- a/src/obofoundry/utils.py
+++ b/src/obofoundry/utils.py
@@ -3,11 +3,12 @@
 import requests
 import yaml
 
-from obofoundry.constants import ONTOLOGY_DIRECTORY
+from obofoundry.constants import ONTOLOGY_DIRECTORY, ROOT
 
 __all__ = [
     "get_data",
     "query_wikidata",
+    "get_new_data",
 ]
 
 
@@ -41,3 +42,20 @@
     res.raise_for_status()
     res_json = res.json()
     return res_json["results"]["bindings"]
+
+
+def get_new_data():
+    """Get records for ontologies that have additional checks.
+
+    So far, this applies in the following scenarios:
+
+    1. New ontologies, i.e., there's a markdown file for the ontology in the ``/ontologies`` directory
+       but has it not yet been published and does not appear in the config.yml
+    """
+    data = get_data()
+    config_path = ROOT.joinpath("_config.yml")
+    config_data = yaml.safe_load(config_path.read_text())
+    published = {record["id"] for record in config_data["ontologies"]}
+    return {
+        prefix: record for prefix, record in data.items() if prefix not in published
+    }

{"golden_diff": "diff --git a/src/obofoundry/utils.py b/src/obofoundry/utils.py\n--- a/src/obofoundry/utils.py\n+++ b/src/obofoundry/utils.py\n@@ -3,11 +3,12 @@\n import requests\n import yaml\n \n-from obofoundry.constants import ONTOLOGY_DIRECTORY\n+from obofoundry.constants import ONTOLOGY_DIRECTORY, ROOT\n \n __all__ = [\n     \"get_data\",\n     \"query_wikidata\",\n+    \"get_new_data\",\n ]\n \n \n@@ -41,3 +42,20 @@\n     res.raise_for_status()\n     res_json = res.json()\n     return res_json[\"results\"][\"bindings\"]\n+\n+\n+def get_new_data():\n+    \"\"\"Get records for ontologies that have additional checks.\n+\n+    So far, this applies in the following scenarios:\n+\n+    1. New ontologies, i.e., there's a markdown file for the ontology in the ``/ontologies`` directory\n+       but has it not yet been published and does not appear in the config.yml\n+    \"\"\"\n+    data = get_data()\n+    config_path = ROOT.joinpath(\"_config.yml\")\n+    config_data = yaml.safe_load(config_path.read_text())\n+    published = {record[\"id\"] for record in config_data[\"ontologies\"]}\n+    return {\n+        prefix: record for prefix, record in data.items() if prefix not in published\n+    }\n", "issue": "Add automated check for licenses\n              Did someone carefully check the repository? It says there the data is licensed under CC BY 4.0-SA, which is not acceptable for OBO Foundry: https://github.com/Dalalghamdi/NGBO\r\n\r\n_Originally posted by @cthoyt in https://github.com/OBOFoundry/OBOFoundry.github.io/issues/2214#issuecomment-1399241788_\r\n            \r\n\r\nWhat happened in NGBO is that the author had a different license in the metadata they submitted to the OBO Foundry than what the LICENSE file said inside their repository. Further, this wasn't carefully checked by reviewers. We should add an automated check for the future to make sure this doesn't happen again.\n", "before_files": [{"content": "\"\"\"Test data integrity, beyond what's possible with the JSON schema.\"\"\"\n\nimport requests\nimport yaml\n\nfrom obofoundry.constants import ONTOLOGY_DIRECTORY\n\n__all__ = [\n    \"get_data\",\n    \"query_wikidata\",\n]\n\n\ndef get_data():\n    \"\"\"Get ontology data.\"\"\"\n    ontologies = {}\n    for path in ONTOLOGY_DIRECTORY.glob(\"*.md\"):\n        with open(path) as file:\n            lines = [line.rstrip(\"\\n\") for line in file]\n\n        assert lines[0] == \"---\"\n        idx = min(i for i, line in enumerate(lines[1:], start=1) if line == \"---\")\n\n        # Load the data like it is YAML\n        data = yaml.safe_load(\"\\n\".join(lines[1:idx]))\n        data[\"long_description\"] = \"\".join(lines[idx:])\n        ontologies[data[\"id\"]] = data\n    return ontologies\n\n\n#: WikiData SPARQL endpoint. See https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service#Interfacing\nWIKIDATA_SPARQL = \"https://query.wikidata.org/bigdata/namespace/wdq/sparql\"\n\n\ndef query_wikidata(query: str):\n    \"\"\"Query the Wikidata SPARQL endpoint and return JSON.\"\"\"\n    headers = {\"User-Agent\": \"obofoundry/1.0 (https://obofoundry.org)\"}\n    res = requests.get(\n        WIKIDATA_SPARQL, params={\"query\": query, \"format\": \"json\"}, headers=headers\n    )\n    res.raise_for_status()\n    res_json = res.json()\n    return res_json[\"results\"][\"bindings\"]\n", "path": "src/obofoundry/utils.py"}], "after_files": [{"content": "\"\"\"Test data integrity, beyond what's possible with the JSON schema.\"\"\"\n\nimport requests\nimport yaml\n\nfrom obofoundry.constants import ONTOLOGY_DIRECTORY, ROOT\n\n__all__ = [\n    \"get_data\",\n    \"query_wikidata\",\n    \"get_new_data\",\n]\n\n\ndef get_data():\n    \"\"\"Get ontology data.\"\"\"\n    ontologies = {}\n    for path in ONTOLOGY_DIRECTORY.glob(\"*.md\"):\n        with open(path) as file:\n            lines = [line.rstrip(\"\\n\") for line in file]\n\n        assert lines[0] == \"---\"\n        idx = min(i for i, line in enumerate(lines[1:], start=1) if line == \"---\")\n\n        # Load the data like it is YAML\n        data = yaml.safe_load(\"\\n\".join(lines[1:idx]))\n        data[\"long_description\"] = \"\".join(lines[idx:])\n        ontologies[data[\"id\"]] = data\n    return ontologies\n\n\n#: WikiData SPARQL endpoint. See https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service#Interfacing\nWIKIDATA_SPARQL = \"https://query.wikidata.org/bigdata/namespace/wdq/sparql\"\n\n\ndef query_wikidata(query: str):\n    \"\"\"Query the Wikidata SPARQL endpoint and return JSON.\"\"\"\n    headers = {\"User-Agent\": \"obofoundry/1.0 (https://obofoundry.org)\"}\n    res = requests.get(\n        WIKIDATA_SPARQL, params={\"query\": query, \"format\": \"json\"}, headers=headers\n    )\n    res.raise_for_status()\n    res_json = res.json()\n    return res_json[\"results\"][\"bindings\"]\n\n\ndef get_new_data():\n    \"\"\"Get records for ontologies that have additional checks.\n\n    So far, this applies in the following scenarios:\n\n    1. New ontologies, i.e., there's a markdown file for the ontology in the ``/ontologies`` directory\n       but has it not yet been published and does not appear in the config.yml\n    \"\"\"\n    data = get_data()\n    config_path = ROOT.joinpath(\"_config.yml\")\n    config_data = yaml.safe_load(config_path.read_text())\n    published = {record[\"id\"] for record in config_data[\"ontologies\"]}\n    return {\n        prefix: record for prefix, record in data.items() if prefix not in published\n    }\n", "path": "src/obofoundry/utils.py"}]}