-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c07e63
commit f4d5e53
Showing
8 changed files
with
408 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Sample Queries for Software Technik Trends | ||
# | ||
# WF 2024-03-08 | ||
'STT-Papers': | ||
sparql: | | ||
# Papers published in a certain venue | ||
# e.g. Softwaretechnik-Trends | ||
# WF 2024-03-08 | ||
PREFIX dblp: <https://dblp.org/rdf/schema#> | ||
SELECT | ||
?paper | ||
?title | ||
(GROUP_CONCAT(DISTINCT ?author; SEPARATOR="; ") AS ?authors) | ||
?year | ||
?archivedWebpage | ||
?listedOnTocPage | ||
?volume | ||
?issue | ||
(COUNT(DISTINCT ?author) AS ?author_count) | ||
WHERE { | ||
?paper dblp:publishedIn "Softwaretechnik-Trends". | ||
OPTIONAL{?paper dblp:title ?title .} | ||
OPTIONAL{?paper dblp:authoredBy ?author .} | ||
OPTIONAL{?paper dblp:yearOfPublication ?year .} | ||
OPTIONAL{?paper dblp:archivedWebpage ?archivedWebpage .} | ||
OPTIONAL{?paper dblp:listedOnTocPage ?listedOnTocPage .} | ||
OPTIONAL{?paper dblp:publishedInJournalVolume ?volume .} | ||
OPTIONAL{?paper dblp:publishedInJournalVolumeIssue ?issue .} | ||
# Other fields from the n-triples not explicitly queried due to their nature or presumed relevance. | ||
# This includes fields like hasIdentifier, hasSignature, etc., which are typically used for internal management or more detailed data tracking. | ||
} | ||
GROUP BY ?paper ?title ?year ?archivedWebpage ?listedOnTocPage ?volume ?issue | ||
ORDER BY ?year |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
""" | ||
Created on 2024-03-08 | ||
@author: wf | ||
""" | ||
from lodstorage.yamlable import lod_storable | ||
from dataclasses import field | ||
from typing import List, Optional | ||
from ez_wikidata.wdproperty import PropertyMapping, WdDatatype | ||
import rispy | ||
|
||
@lod_storable | ||
class RIS_Entry: | ||
""" | ||
Research Information Systems format | ||
https://en.wikipedia.org/wiki/RIS_(file_format) | ||
""" | ||
type_of_reference: Optional[str] = None | ||
abstract: Optional[str] = None | ||
type_of_work: Optional[str] = None | ||
year: Optional[str] = None | ||
doi: Optional[str] = None | ||
keywords: List[str] = field(default_factory=list) | ||
first_authors: List[str] = field(default_factory=list) | ||
publisher: Optional[str] = None | ||
language: Optional[str] = None | ||
primary_title: Optional[str] = None | ||
urls: List[str] = field(default_factory=list) | ||
secondary_title: Optional[str] = None | ||
|
||
@property | ||
def lang_qid(self)->str: | ||
qid="Q1860" # English | ||
if self.language=="de": | ||
qid="Q188" | ||
return qid | ||
|
||
@classmethod | ||
def get_property_mappings(cls): | ||
""" | ||
get the wikidata property mappings | ||
""" | ||
mappings=[ | ||
PropertyMapping( | ||
column="instanceof", | ||
propertyName="instanceof", | ||
propertyId="P31", | ||
propertyType=WdDatatype.itemid, | ||
value="Q13442814", # scholarly article | ||
), | ||
PropertyMapping( | ||
column="primary_title", | ||
propertyName="title", | ||
propertyId="P1476", | ||
propertyType=WdDatatype.text, | ||
), | ||
PropertyMapping( | ||
column="doi", | ||
#propertyName="DOI", | ||
#propertyId="P356", | ||
propertyName="described at URL", | ||
propertyId="P973", | ||
#propertyType=WdDatatype.extid, | ||
propertyType=WdDatatype.url | ||
), | ||
PropertyMapping( | ||
column="lang_qid", | ||
propertyName="language of work or name", | ||
propertyId="P407", | ||
propertyType=WdDatatype.itemid, | ||
), | ||
PropertyMapping( | ||
column="year", | ||
propertyName="publication date", | ||
propertyId="P577", | ||
propertyType=WdDatatype.year, | ||
), | ||
] | ||
return mappings | ||
|
||
@classmethod | ||
def get_dict_from_file(cls,ris_file_path,by_field:str="index"): | ||
ris_dict={} | ||
with open(ris_file_path, 'r') as bibliography_file: | ||
entries = rispy.load(bibliography_file) | ||
for i,entry in enumerate(entries,start=1): | ||
ris_entry=RIS_Entry.from_dict(entry) | ||
if by_field=="index": | ||
value=i | ||
else: | ||
if by_field in entry: | ||
value=field[entry] | ||
ris_dict[value]=ris_entry | ||
|
||
return ris_dict | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.