Skip to content

Commit

Permalink
fixed papers_dblp endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tholzheim committed May 17, 2024
1 parent d0b0752 commit b9f2c4e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
5 changes: 1 addition & 4 deletions ceurws/ceur_ws.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import calendar
import datetime
import re
Expand Down Expand Up @@ -658,9 +657,7 @@ class Session(JSONAble):
Represents a session in ceur-ws
"""

def __init__(
self, id: str | None, title: str | None, position: int | None, papers: dict[str, "Paper"] | None
):
def __init__(self, id: str | None, title: str | None, position: int | None, papers: dict[str, "Paper"] | None):
"""
constructor
"""
Expand Down
1 change: 0 additions & 1 deletion ceurws/models/dblp2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: wf
"""


from sqlmodel import Field, SQLModel


Expand Down
1 change: 0 additions & 1 deletion ceurws/namedqueries.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: wf
"""


from lodstorage.query import Query, QueryManager
from wikibot3rd.smw import SMWClient
from wikibot3rd.wikiclient import WikiClient
Expand Down
10 changes: 7 additions & 3 deletions ceurws/services/entity_fishing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import contextlib
import json
import logging
from email import iterators
from collections.abc import Iterable

import requests
from spacy import util
Expand Down Expand Up @@ -94,7 +94,11 @@ def __init__(

@staticmethod
def generic_client_batch(
method: str, url_batch: list[str], verbose: bool, params: dict = None, files_batch: list[dict] = None
method: str,
url_batch: list[str],
verbose: bool,
params: dict | None = None,
files_batch: list[dict] | None = None,
) -> list[requests.Response]:
"""
It takes a list of urls and a list of files, and it sends a request to each url with the
Expand Down Expand Up @@ -436,7 +440,7 @@ def __call__(self, doc: Doc) -> Doc:
)[0]
return self.process_single_doc_after_call(doc, result_from_ef_text)

def pipe(self, stream: iterators, batch_size: int = 128) -> Doc:
def pipe(self, stream: Iterable, batch_size: int = 128) -> Doc:
"""
For each batch of documents, we disambiguate the named entities in the documents, and then yield
the results
Expand Down
1 change: 0 additions & 1 deletion ceurws/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: wf
"""


from ngwidgets.widgets import Link
from tabulate import tabulate

Expand Down
9 changes: 6 additions & 3 deletions ceurws/webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
from pathlib import Path

import orjson
from fastapi import HTTPException
from fastapi.responses import ORJSONResponse
from ngwidgets.input_webserver import InputWebserver, InputWebSolution
Expand Down Expand Up @@ -91,9 +92,11 @@ async def papers_dblp():
"""
direct fastapi return of paper information from dblp
"""
self.wdSync.dblp_papers.load()
papers = self.wdSync.dblp_papers.papers
return ORJSONResponse(papers)
self.wdSync.dblpEndpoint.dblp_papers.load()
papers = self.wdSync.dblpEndpoint.dblp_papers.papers
records = [p.to_json() for p in papers[:5]]
lod = [orjson.loads(json_str) for json_str in records]
return ORJSONResponse(lod)

@app.get(
"/authors_dblp.json",
Expand Down

0 comments on commit b9f2c4e

Please sign in to comment.