pysotsog API Documentation
citeproc
Created on 2022-12-21
@author: wf
Citeproc
see https://en.wikipedia.org/wiki/CiteProc
Source code in skg/citeproc.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
asScite(meta_data, retrieved_from)
classmethod
convert the given meta data to #Scite format
see https://github.com/SemanticMediaWiki/SemanticCite/blob/master/src/FilteredMetadata/BibliographicFilteredRecord.php Args: meta_data(dict): the citeproc compatible metadata dict to convert retrieved_from(str): the url the metadata was retrieved from
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Semantic Mediawiki markup |
Source code in skg/citeproc.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
crossref
Created on 17.11.2022
@author: wf
Crossref
Crossref access
Source code in skg/crossref.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(mailto=None, ua_string=None)
constructor
Source code in skg/crossref.py
19 20 21 22 23 24 25 26 27 28 |
|
asScite(meta_data)
convert the given meta data to #Scite format
see https://github.com/SemanticMediaWiki/SemanticCite/blob/master/src/FilteredMetadata/BibliographicFilteredRecord.php
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Semantic Mediawiki markup |
Source code in skg/crossref.py
54 55 56 57 58 59 60 61 62 63 64 |
|
doiBibEntry(dois)
get bib entries for the given dois
Source code in skg/crossref.py
47 48 49 50 51 52 |
|
doiMetaData(dois)
get the meta data for the given dois
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doi(list) |
a list of dois |
required |
Source code in skg/crossref.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
dblp
Created on 2022-11-17
@author: wf
Dblp
Schloss Dagstuhl Dblp computer science bibliography
Source code in skg/dblp.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
|
__init__(endpoint='https://qlever.cs.uni-freiburg.de/api/dblp')
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint(str) |
the endpoint to use |
required |
Source code in skg/dblp.py
17 18 19 20 21 22 23 24 25 26 27 28 |
|
get_paper_records(regex, prop_name='title', limit=100, debug=False)
get papers fitting the given regex
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prop_name(str) |
the property to filter |
required | |
regex(str) |
the regex to filter for |
required | |
limit(int) |
the maximum number of records to return |
required | |
debug(bool) |
if True show debug information |
required |
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
a list of dict of paper records |
Source code in skg/dblp.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
dblp2wikidata
Created on 2024-02-26
@author: wf
Dblp2Wikidata
utility for transfering Dblp person entries to Wikidata
Source code in skg/dblp2wikidata.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
transfer(args)
Main method to handle the transfer of DBLP entries to Wikidata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args(Namespace) |
Command line arguments. |
required |
Source code in skg/dblp2wikidata.py
19 20 21 22 23 24 25 26 27 28 |
|
doi
Created on 2022-11-22
@author: wf
DOI
Digital Object Identifier handling
see e.g. https://www.wikidata.org/wiki/Property:P356 see https://www.doi.org/doi_handbook/2_Numbering.html#2.2 see https://github.com/davidagraf/doi2bib2/blob/master/server/doi2bib.js see https://citation.crosscite.org/docs.html
Source code in skg/doi.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
__init__(doi)
a DOI
Source code in skg/doi.py
31 32 33 34 35 36 37 38 39 |
|
asScite()
get DOI metadata and convert to Semantic Cite markup
see https://github.com/SemanticMediaWiki/SemanticCite/blob/master/src/FilteredMetadata/BibliographicFilteredRecord.php
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
Semantic Mediawiki markup |
Source code in skg/doi.py
136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
dataCiteLookup()
get the dataCite json result for my doi
Source code in skg/doi.py
128 129 130 131 132 133 134 |
|
doi2Citeproc()
get the Citeproc JSON result for my doi see https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html
Source code in skg/doi.py
119 120 121 122 123 124 125 126 |
|
doi2bibTex()
get the bibtex result for my doi
Source code in skg/doi.py
111 112 113 114 115 116 117 |
|
fetch_json(url, headers)
fetch json for the given url with the given headers
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url(str) |
the url to fetch the data for |
required | |
headers(dict) |
the headers to use |
required |
Returns:
Name | Type | Description |
---|---|---|
json |
json data |
Source code in skg/doi.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
fetch_response(url, headers)
fetch reponse for the given url with the given headers
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url(str) |
the url to fetch the data for |
required | |
headers(dict) |
the headers to use |
required |
Source code in skg/doi.py
61 62 63 64 65 66 67 68 69 70 71 |
|
fetch_text(url, headers)
fetch text for the given url with the given headers
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url(str) |
the url to fetch the data for |
required | |
headers(dict) |
the headers to use |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the text |
Source code in skg/doi.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
|
isDOI(doi)
classmethod
check that the given string is a doi
Parameters:
Name | Type | Description | Default |
---|---|---|---|
doi(str) |
the potential DOI string |
required |
Source code in skg/doi.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
event
Created on 2022-11-16
@author: wf
Event
Bases: Node
an instance of a scientific event
Source code in skg/event.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
EventSeries
Bases: Node
an instance of an academic event series
Source code in skg/event.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
Proceedings
Bases: Node
Proceedings of an event
Source code in skg/event.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
graph
Created on 2022-11-16
@author: wf
Concept
an Entity
Source code in skg/graph.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
__init__(name, cls)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name(str) |
the name of the node |
required | |
cls |
a class |
required |
Source code in skg/graph.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
map(map_name, map_list)
map the given list of property mappings under the given map_name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
map_name(str) |
the name of the mapping e.g. "wikidata" |
required | |
map_list(list) |
a list of mapping tuples |
required |
Source code in skg/graph.py
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
map_wikidata(wd_class, scholia_suffix, map_list)
map wikidata entries
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wd_class(str) |
the main wikidata base class |
required | |
scholia_suffix(str) |
the scholia suffix |
required |
Source code in skg/graph.py
49 50 51 52 53 54 55 56 57 58 59 60 |
|
Node
a Node in the scholary knowledge graph
Source code in skg/graph.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
__init__()
constructor
Source code in skg/graph.py
110 111 112 113 |
|
__str__()
return a text representation of me
Source code in skg/graph.py
115 116 117 118 119 120 121 122 123 124 |
|
browser_url()
get my browser url
Source code in skg/graph.py
136 137 138 139 140 141 142 143 144 |
|
from_dblp_via_id(concept, id_name, id_value, lang='en')
classmethod
get a node instance from dblp for the given parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
concept(Concept) |
the concept to return |
required | |
id_name(str) |
the name of the id to search / lookup with |
required | |
id_value(str) |
the value of the id |
required | |
lang(str) |
the language code to apply |
required |
Source code in skg/graph.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
from_dict(concept, record)
get my values from the given record
Source code in skg/graph.py
126 127 128 129 130 131 132 133 134 |
|
from_records(records, concept)
classmethod
get instances from the given records for the given concept
Parameters:
Name | Type | Description | Default |
---|---|---|---|
records(list) |
a list of dicts to get instances for |
required | |
concept(Concept) |
the concept to create instances for |
required |
Source code in skg/graph.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
from_sparql(sparql, sparql_query, concept)
classmethod
get instance from the given sparql access point with the given sparql_query for the given concept
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sparql(SPARQL) |
the sparql access point |
required | |
sparql_query(str) |
the query to execute |
required | |
concept(Concept) |
the concept to create instances for |
required |
Source code in skg/graph.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
|
from_wikidata_via_id(concept, id_name, id_value, lang='en')
classmethod
get a node instance from wikidata for the given parameters
Parameters:
Name | Type | Description | Default |
---|---|---|---|
concept(Concept) |
the concept to return |
required | |
id_name(str) |
the name of the id to search / lookup with |
required | |
id_value(str) |
the value of the id |
required | |
lang(str) |
the language code to apply |
required |
Source code in skg/graph.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
scholia_url()
get my scholia url
Source code in skg/graph.py
146 147 148 149 150 151 152 153 154 155 156 |
|
setProvenance(instances, provenance)
classmethod
set the provenance of the given instances
Source code in skg/graph.py
158 159 160 161 162 163 164 |
|
Property
a Property
Source code in skg/graph.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
__init__(concept, name)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
concept(Concept) |
the concept this property belongs to |
required | |
name(str) |
the name of the property |
required |
Source code in skg/graph.py
68 69 70 71 72 73 74 75 76 77 78 79 |
|
hasmap(map_name)
check whether there is a mapping for the given map_name
Parameters:
Name | Type | Description | Default |
---|---|---|---|
map_name(str) |
the map name to check |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if there is mapping |
Source code in skg/graph.py
90 91 92 93 94 95 96 97 98 99 100 |
|
setmap(map_name, mapped_prop)
map the given property
Source code in skg/graph.py
81 82 83 84 85 |
|
kg
Created on 2022-11-16
@author: wf
SKG_Def
scholary knowledge graph
Source code in skg/kg.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
__init__()
constructor
Source code in skg/kg.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
conceptForQid(qid)
get the concept for the given wikidata Q Identifieer
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qid(str) |
get the concept for the given Qid |
required |
Return
Concept: or None if none is found
Source code in skg/kg.py
155 156 157 158 159 160 161 162 163 164 165 166 |
|
toPlantuml(header=None, footer=None)
get a plantuml version of this knowledge graph
Parameters:
Name | Type | Description | Default |
---|---|---|---|
header(str) |
the header to apply |
required | |
footer(str) |
the footer to apply |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the plantuml markup |
Source code in skg/kg.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
|
toSiDiF()
convert me to SiDiF format
Source code in skg/kg.py
203 204 205 206 207 208 209 210 211 212 213 214 215 |
|
location
Created on 2022-11-21
@author: wf
Country
Bases: Node
an instance of a country
Source code in skg/location.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
orcid
Created on 2022-11-19
@author: wf
ORCID
ORCID handling
see e.g. https://info.orcid.org/brand-guidelines/#h-orcid-logos-and-icons https://pub.orcid.org/v3.0/
Source code in skg/orcid.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
__init__(orcid)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orcid(str) |
the orcid |
required |
Source code in skg/orcid.py
24 25 26 27 28 29 30 31 32 33 34 35 |
|
asHtml(mode='full', inline='')
the orcid logo
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode(str) |
the mode |
required | |
inline(str) |
in inline mode this is the text to be displayed inline |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the html code |
Source code in skg/orcid.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
getMetadata(op=None)
get the ORCID metadata data
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op(str) |
the https://pub.orcid.org/v3.0/ API |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the dictionary derived from the JSON response |
Source code in skg/orcid.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
isORCID(orcid)
classmethod
check that the given string is an ORCID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
orcid(str) |
the potential ORCID string |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if the string represents a valid ORCID otherwise false |
Source code in skg/orcid.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
owl
Created on 2022-11-22
@author: wf
Owl
Bases: Schema
Web Ontology Language access see https://en.wikipedia.org/wiki/Web_Ontology_Language
Source code in skg/owl.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
__init__(name, url, authors, inception)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name(str) |
the name of this schema |
required | |
url(str) |
the url of this schema |
required | |
authors(str) |
the authors of this schema |
required | |
inception(str) |
the inception of this schema |
required |
Source code in skg/owl.py
22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
loadSchema(formats='', profile=False)
load the schema
Parameters:
Name | Type | Description | Default |
---|---|---|---|
formats(str) |
the formats to dump |
required | |
profile(bool) |
if True show timing |
required |
Source code in skg/owl.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
query_schema(query, formats='', profile=False)
query the schema
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query(str) |
the SPARQL query to execute |
required | |
formats(str) |
if "triples" is in th format string show the results string |
required | |
profile(bool) |
if True show timing information for the query |
required |
Source code in skg/owl.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
show_triples(result)
show the triples for the given query result
Source code in skg/owl.py
36 37 38 39 40 41 |
|
toClasses()
convert to a classes dict of dicts
Returns:
Name | Type | Description |
---|---|---|
dict |
a dict of dictionaries |
Source code in skg/owl.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
unprefix_row(row)
get rid of the RDF prefixes in keys and values of the given row to simplify our life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
row(dict) |
a dict of RDF values to unprefix |
required |
Source code in skg/owl.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
unprefix_value(value, prefixes=['http://xmlns.com/foaf/0.1/'])
get rid of RDF prefixes to simplify our life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value(object) |
the RDFLib value to unprefix |
required | |
prefixes(list) |
list of prefixes to remove |
required |
Returns: str: a simple string representation
Source code in skg/owl.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
paper
Created on 2022-11-16
@author: wf
Paper
Bases: Node
a scientific paper
Source code in skg/paper.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
__init__()
Constructor
Source code in skg/paper.py
33 34 35 36 |
|
fromDOI(doi)
construct me from the given doi
Source code in skg/paper.py
38 39 40 41 42 43 44 45 46 47 48 |
|
profiler
Created on 2022-11-18
@author: wf
Profiler
simple profiler
Source code in skg/profiler.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
__init__(msg, profile=True)
construct me with the given msg and profile active flag
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(str) |
the message to show if profiling is active |
required | |
profile(bool) |
True if messages should be shown |
required |
Source code in skg/profiler.py
15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
time(extraMsg='')
time the action and print if profile is active
Source code in skg/profiler.py
29 30 31 32 33 34 35 36 |
|
ris
Created on 2024-03-08
@author: wf
RIS_Entry
Research Information Systems format https://en.wikipedia.org/wiki/RIS_(file_format)
Source code in skg/ris.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
get_property_mappings()
classmethod
get the wikidata property mappings
Source code in skg/ris.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
schema
Created on 2022-11-22
@author: wf
Schema
a schema
Source code in skg/schema.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
__init__(name, url, authors, inception)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name(str) |
the name of this schema |
required | |
url(str) |
the url of this schema |
required | |
authors(str) |
the authors of this schema |
required | |
inception(str) |
the inception of this schema |
required |
Source code in skg/schema.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
classesToPlantUml(classes, indent=' ')
convert the given classes dict to plantuml
Parameters:
Name | Type | Description | Default |
---|---|---|---|
classes(dict) |
a dictionary of classes |
required | |
indent(str) |
the indentation to apply |
required |
Source code in skg/schema.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
toPlantUml(header=None, footer=None)
get a plantuml version of the schema
Parameters:
Name | Type | Description | Default |
---|---|---|---|
header(str) |
the header to apply |
required | |
footer(str) |
the footer to apply |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the plantuml markup |
Source code in skg/schema.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
scholar
Created on 2022-11-16
@author: wf
Institution
Bases: Node
academic institution a scholar might be affiliated with
Source code in skg/scholar.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__()
constructor
Source code in skg/scholar.py
72 73 74 75 |
|
Scholar
Bases: Node
an instance of a scholar that writes papers to be an author
Source code in skg/scholar.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
__init__()
constructor
Source code in skg/scholar.py
45 46 47 48 |
|
scholargrid
Created on 2023-01-04
@author: wf
ScholarGrid
Bases: SmwGrid
show a grid of scholars
Source code in skg/scholargrid.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
__init__(app, wikiUsers, wikiId, sparql, debug=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app(App) |
the app that I am part of |
required | |
wikiUsers(list) |
the wikiUsers |
required | |
wikiId(str) |
the wikiId to use |
required | |
sparql(SPARQL) |
the SPARQL endpoint to use |
required | |
debug(bool) |
if True show debugging information |
required |
Source code in skg/scholargrid.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
|
getScholars()
get the list of scholars
Returns:
Name | Type | Description |
---|---|---|
list |
list
|
the list of dicts of scholars |
Source code in skg/scholargrid.py
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
ScholarQuery
Source code in skg/scholargrid.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get()
classmethod
get the WikiBaseQuery for scholars
Returns:
Name | Type | Description |
---|---|---|
WikibaseQuery |
WikibaseQuery
|
the wikibase query |
Source code in skg/scholargrid.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
SmwGrid
Bases: GridSync
a semantic mediawiki based grid synchable with WikiData
Source code in skg/scholargrid.py
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
__init__(solution, entityName, entityPluralName, pk, getLod, wikiUsers, wikiId, sparql, debug=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
solution |
the solutio that i am part of |
required | |
entityName(str) |
the name of the entity type of items to be shown in the grid |
required | |
entityPluralName(str) |
the plural name of the entities to be shown |
required | |
pk(str) |
the name of the primary key |
required | |
getLod(Callable) |
the callback to load the grid rows list of dicts |
required | |
wikiUsers(list) |
the wikiUsers |
required | |
wikiId(str) |
the wikiId to use |
required | |
sparql(SPARQL) |
the SPARQL endpoint to use |
required | |
debug(bool) |
if True show debugging information |
required |
Source code in skg/scholargrid.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
|
search
Created on 2022-11-19
@author: wf
SearchOptions
wrapper for search results
Source code in skg/search.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
__init__(limit=9, lang='en', show=True, markup_names=['bibtex'], open_browser=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit(int) |
limit for the maximum number of results |
required | |
lang(str) |
the language code to use for the search |
required | |
show(bool) |
if True print the search results |
required | |
markup_names(list) |
a list of markup names to support |
required | |
open_browser(bool) |
if True open a browser for the target page of the item e.g. scholia |
required |
Source code in skg/search.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
SearchResult
wrapper for search results
Source code in skg/search.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
__init__(search_list, options=SearchOptions)
constructor
Args: search_list(list): a list of search terms options(SearchOptions): the search options to apply
Source code in skg/search.py
44 45 46 47 48 49 50 51 52 53 54 |
|
searchengine
Created on 18.11.2022
@author: wf
InternetSearch
generic internet search
Source code in skg/searchengine.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
__init__(debug=False)
constructor
Source code in skg/searchengine.py
23 24 25 26 27 28 29 30 31 32 33 |
|
handleException(ex)
handle the given exception
Source code in skg/searchengine.py
35 36 37 38 39 40 |
|
search(search_term)
search my engines for the given search_term
Source code in skg/searchengine.py
42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
semantic_scholar
Created on 2022-11-22
@author: wf
SemanticScholar
wrapper for Semantic Scholar API
Source code in skg/semantic_scholar.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
__init__()
constructor
Source code in skg/semantic_scholar.py
16 17 18 19 20 |
|
get_author()
https://api.semanticscholar.org/api-docs/graph#tag/Author-Data/operation/get_graph_get_author_search
Source code in skg/semantic_scholar.py
29 30 31 32 33 |
|
get_paper(doi)
get the paper with the given DOI identifier
Source code in skg/semantic_scholar.py
22 23 24 25 26 27 |
|
skgbrowser
Created on 2022-11-18
@author: wf
SkgBrowser
Bases: InputWebserver
scholary knowledge graph browser
Source code in skg/skgbrowser.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
__init__()
Constructs all the necessary attributes for the WebServer object.
Source code in skg/skgbrowser.py
39 40 41 42 43 44 45 46 |
|
SkgSolution(InputWebSolution)
the scholarly knowledge graph solution
Source code in skg/skgbrowser.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
smw
Created on 22.11.2022
@author: wf
SemWiki
access to Semantic mediawiki
Source code in skg/smw.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
__init__(wikiUser, withLogin=None)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wikiUser |
WikiUser
|
WikiUser |
required |
Source code in skg/smw.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
asMarkup(scholar)
classmethod
return the markup for the given scholar
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scholar(Node) |
the scholar |
required |
Returns: str: the semantic mediawiki markup
Source code in skg/smw.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
id_refs(mainlabel='pageTitle', condition='DOI::+', title='DOI references', askExtra='', id_prop='DOI', id_name='doi')
get a list of id references from the given wiki
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mainlabel(str) |
the mainlabel to use |
required | |
condition(str) |
the condition to apply |
required | |
title(str) |
the title of the query |
required |
Source code in skg/smw.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
papers()
get the paper records
Source code in skg/smw.py
63 64 65 66 67 68 69 70 71 |
|
scholars()
get scholars
Source code in skg/smw.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
sotsog
Created on 2022-11-16
@author: wf
SotSog
Standing on the shoulders of giants
Source code in skg/sotsog.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
__init__()
constructor
Source code in skg/sotsog.py
27 28 29 30 31 32 33 34 35 36 37 |
|
getMarkups(item, options)
get the markups for the given item and search options
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item(Node) |
the item to get the markup for |
required | |
options(SearchOptions) |
the search options to apply |
required |
Source code in skg/sotsog.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
handleItem(item, item_id, itemLabel, desc, options)
handle the given item as a search result
Source code in skg/sotsog.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
handleItems(items, options)
handle the given items
Source code in skg/sotsog.py
115 116 117 118 119 120 121 122 123 |
|
search(search_list, options)
search with the given search list
Parameters:
Name | Type | Description | Default |
---|---|---|---|
search_list(list) |
a list of search terms |
required | |
options(SearchOptions) |
the search options to apply |
required |
Source code in skg/sotsog.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
wd_search(wd, search_term, options)
do a wikidata search
Source code in skg/sotsog.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
sotsog_cmd
Created on 2024-02-26
@author: wf
SotSogCmd
Bases: WebserverCmd
command line handling for Standing on the Shoulders of Giants
Source code in skg/sotsog_cmd.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
__init__()
constructor
Source code in skg/sotsog_cmd.py
22 23 24 25 26 27 |
|
getArgParser(description, version_msg)
override the default argparser call
Source code in skg/sotsog_cmd.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
handle_args()
handle the command line args
Source code in skg/sotsog_cmd.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
main(argv=None)
main call
Source code in skg/sotsog_cmd.py
95 96 97 98 99 100 101 |
|
version
Created on 2022-04-01
@author: wf
Version
Bases: object
Version handling for pysotsog
Source code in skg/version.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
wdsearch
Created on 24.07.2022
@author: wf
WikidataSearch
Bases: object
Wikidata Search
Source code in skg/wdsearch.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
__init__(language='en', timeout=2.0, debug=False)
Constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
language(str) |
the language to use e.g. en/fr |
required | |
timeout(float) |
maximum time to wait for result |
required | |
debug(bool) |
if True debug details should be shown |
required |
Source code in skg/wdsearch.py
18 19 20 21 22 23 24 25 26 27 28 29 |
|
search(searchFor, limit=9)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
searchFor(str) |
the string to search for |
required | |
limit(int) |
the maximum amount of results to search for |
required |
Source code in skg/wdsearch.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
searchOptions(searchFor, limit=9)
search and return a list of qid,itemLabel description tuples
Parameters:
Name | Type | Description | Default |
---|---|---|---|
searchFor(str) |
the string to search for |
required | |
limit(int) |
the maximum amount of results to search for |
required |
Source code in skg/wdsearch.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
wikidata
Created on 2022-11-16
@author: wf
Wikidata
Wikidata access wrapper
Source code in skg/wikidata.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
__init__(endpoint='https://query.wikidata.org/sparql', debug=False)
constructor
Source code in skg/wikidata.py
18 19 20 21 22 23 24 25 26 27 |
|
getClassQids(qids)
get the Wikidata Q-Identifiers for the given wikidata ids
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qids(list) |
the list of id |
required |
Source code in skg/wikidata.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
getLabelForQid(qid, lang='en')
classmethod
get a label for the given Wikidata QID
Parameters:
Name | Type | Description | Default |
---|---|---|---|
qid(str) |
the Wikidata ID |
required | |
lang(str) |
the language |
required |
Source code in skg/wikidata.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|