Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
f5443d84
Commit
f5443d84
authored
10 years ago
by
Mathieu Rodic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEATURE] Added 'authors' metadata support
[ANOMALY] Fixed buggy behaviour of query type 'fields'
parent
8735df68
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
12 deletions
+15
-12
MatInit.py
MatInit.py
+0
-4
api.py
gargantext_web/api.py
+5
-5
PubmedFileParser.py
parsing/FileParsers/PubmedFileParser.py
+10
-3
No files found.
MatInit.py
View file @
f5443d84
...
...
@@ -10,10 +10,6 @@ os.environ.setdefault("DJANGO_HSTORE_GLOBAL_REGISTER", "False")
from
node.models
import
*
# Node.objects.get(id=26514).children.all().make_metadata_filterable()
# exit()
# Reset: all data
tables_to_empty
=
[
...
...
This diff is collapsed.
Click to expand it.
gargantext_web/api.py
View file @
f5443d84
...
...
@@ -428,10 +428,10 @@ class NodesChildrenQueries(APIView):
# TODO: date_trunc (psql) -> index also
# groupping
if
retrieve
[
'type'
]
==
'aggregates'
:
authorized_aggregates
=
{
'count'
:
func
.
count
(
Node
.
id
)}
for
field_name
in
fields_names
:
if
field_name
not
in
authorized_aggregates
:
# query = query.group_by(text(field_name))
query
=
query
.
group_by
(
'"
%
s"'
%
(
field_name
,
))
# sorting
...
...
This diff is collapsed.
Click to expand it.
parsing/FileParsers/PubmedFileParser.py
View file @
f5443d84
...
...
@@ -25,13 +25,20 @@ class PubmedFileParser(FileParser):
"publication_year"
:
'MedlineCitation/DateCreated/Year'
,
"publication_month"
:
'MedlineCitation/DateCreated/Month'
,
"publication_day"
:
'MedlineCitation/DateCreated/Day'
,
"authors"
:
'MedlineCitation/Article/AuthorList'
,
}
for
key
,
path
in
metadata_path
.
items
():
try
:
node
=
xml_article
.
find
(
path
)
metadata
[
key
]
=
node
.
text
xml_node
=
xml_article
.
find
(
path
)
if
key
==
'authors'
:
metadata
[
key
]
=
', '
.
join
([
xml_author
.
find
(
'ForeName'
)
.
text
+
' '
+
xml_author
.
find
(
'LastName'
)
.
text
for
xml_author
in
xml_node
])
else
:
metadata
[
key
]
=
xml_node
.
text
except
:
metadata
[
key
]
=
""
pass
metadata_list
.
append
(
metadata
)
# return the list of metadata
return
metadata_list
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment