Ejemplo n.º 1
0
    def __init__(self, collection, issns=None, output_file=None, years=6):
        self._articlemeta = utils.articlemeta_server()
        self._publicationstats = utils.publicationstats_server()
        self._analytics = Analytics()
        self.collection = collection
        self.issns = issns
        self._years = years
        self._lines = []
        self.output_file = codecs.open(output_file, 'w', encoding='utf-8') if output_file else output_file
        now = datetime.date.today().year
        years_range = [i for i in range(now, now-self._years, -1)]
        header = []
        header.append(u"extraction date")
        header.append(u"study unit")
        header.append(u"collection")
        header.append(u"ISSN SciELO")
        header.append(u"ISSN\'s")
        header.append(u"title at SciELO")
        header.append(u"title thematic areas")
        for area in choices.THEMATIC_AREAS:
            header.append(u"title is %s" % area.lower())
        header.append(u"title is multidisciplinary")
        header.append(u"title current status")
        header.append(u"title + subtitle SciELO")
        header.append(u"short title SciELO")
        header.append(u"short title ISO")
        header.append(u"title PubMed")
        header.append(u"publisher name")
        header.append(u"use license")
        header.append(u"alpha frequency")
        header.append(u"numeric frequency (in months)")
        header.append(u"inclusion year at SciELO")
        header.append(u"stopping year at SciELO")
        header.append(u"stopping reason")
        header.append(u"date of the first document")
        header.append(u"volume of the first document")
        header.append(u"issue of the first document")
        header.append(u"date of the last document")
        header.append(u"volume of the last document")
        header.append(u"issue of the last document")
        header.append(u"total of issues")
        header += [u"issues at %s" % str(i) for i in years_range]
        header.append(u"total of regular issues")
        header += [u"regular issues at %s" % str(i) for i in years_range]
        header.append(u"total of documents")
        header += [u"documents at %s" % str(i) for i in years_range]
        header.append(u"citable documents")
        header += [u"citable documents at %s" % str(i) for i in years_range]
        for year in years_range:
            header.append(u'portuguese documents at %s ' % year)
        for year in years_range:
            header.append(u'spanish documents at %s ' % year)
        for year in years_range:
            header.append(u'english documents at %s ' % year)
        for year in years_range:
            header.append(u'other language documents at %s ' % year)

        self.write(u','.join([u'"%s"' % i.replace(u'"', u'""') for i in header]))
Ejemplo n.º 2
0
    def __init__(self, collection, issns=None, output_file=None):

        self._ratchet = utils.ratchet_server()
        self._articlemeta = utils.articlemeta_server()
        self._publicationstats = utils.publicationstats_server()
        self.collection = collection
        self.issns = issns
        self.output_file = codecs.open(output_file, 'w', encoding='utf-8') if output_file else output_file
        header = [
            u"Título do Periódico (publication_title)",
            u"ISSN impresso (print_identifier)",
            u"ISSN online (online_identifier)",
            u"Data do primeiro fascículo (date_first_issue_online)",
            u"volume do primeiro fascículo (num_first_vol_online)",
            u"número do primeiro fascículo (num_first_issue_online)",
            u"Data do último fascículo publicado (date_last_issue_online)",
            u"volume do último fascículo publicado (num_last_vol_online)",
            u"número do último fascículo publicado (num_last_issue_online)",
            u"url de fascículos (title_url)",
            u"primeiro autor (first_author)",
            u"ID do periódico no SciELO (title_id)",
            u"informação de embargo (embargo_info)",
            u"cobertura (coverage_depth)",
            u"informação sobre cobertura (coverage_notes)",
            u"nome do publicador (publisher_name)",
            u"tipo de publicação (publication_type)",
            u"data de publicação monográfica impressa (date_monograph_published_print)",
            u"data de publicação monográfica online (date_monograph_published_online)",
            u"volume de monografia (monograph_volume)",
            u"edição de monografia (monograph_edition)",
            u"primeiro editor (first_editor)",
            u"ID de publicação pai (parent_publication_title_id)",
            u"ID de publicação prévia (preceding_publication_title_id)",
            u"tipo de acesso (access_type)"

        ]

        self.write(u','.join([u'"%s"' % i.replace(u'"', u'""') for i in header]))
Ejemplo n.º 3
0
    def __init__(self, collection, issns=None, output_file=None):

        self._ratchet = utils.ratchet_server()
        self._articlemeta = utils.articlemeta_server()
        self._publicationstats = utils.publicationstats_server()
        self.collection = collection
        self.issns = issns
        self.output_file = codecs.open(output_file, 'w', encoding='utf-8') if output_file else output_file
        header = [
            u"Título do Periódico (publication_title)",
            u"ISSN impresso (print_identifier)",
            u"ISSN online (online_identifier)",
            u"Data do primeiro fascículo (date_first_issue_online)",
            u"volume do primeiro fascículo (num_first_vol_online)",
            u"número do primeiro fascículo (num_first_issue_online)",
            u"Data do último fascículo publicado (date_last_issue_online)",
            u"volume do último fascículo publicado (num_last_vol_online)",
            u"número do último fascículo publicado (num_last_issue_online)",
            u"url de fascículos (title_url)",
            u"primeiro autor (first_author)",
            u"ID do periódico no SciELO (title_id)",
            u"informação de embargo (embargo_info)",
            u"cobertura (coverage_depth)",
            u"informação sobre cobertura (coverage_notes)",
            u"nome do publicador (publisher_name)",
            u"tipo de publicação (publication_type)",
            u"data de publicação monográfica impressa (date_monograph_published_print)",
            u"data de publicação monográfica online (date_monograph_published_online)",
            u"volume de monografia (monograph_volume)",
            u"edição de monografia (monograph_edition)",
            u"primeiro editor (first_editor)",
            u"ID de publicação pai (parent_publication_title_id)",
            u"ID de publicação prévia (preceding_publication_title_id)",
            u"tipo de acesso (access_type)"

        ]

        self.write(u','.join([u'"%s"' % i.replace(u'"', u'""') for i in header]))
Ejemplo n.º 4
0
    def test_compute_last_included_document_by_journal_without_data(self):
        publicationtats = publicationstats_server()

        query_result = {
            "hits": {
                "hits": [],
                "total": 0,
                "max_score": None
            },
            "took": 4,
            "timed_out": False,
            "_shards": {
                "successful": 5,
                "failed": 0,
                "total": 5
            }
        }

        expected = None

        result = publicationtats._compute_last_included_document_by_journal(query_result)

        self.assertEqual(expected, result)
Ejemplo n.º 5
0
    def test_compute_last_included_document_by_journal_without_data(self):
        publicationtats = publicationstats_server()

        query_result = {
            "hits": {
                "hits": [],
                "total": 0,
                "max_score": None
            },
            "took": 4,
            "timed_out": False,
            "_shards": {
                "successful": 5,
                "failed": 0,
                "total": 5
            }
        }

        expected = None

        result = publicationtats._compute_last_included_document_by_journal(
            query_result)

        self.assertEqual(expected, result)
Ejemplo n.º 6
0
    def __init__(self, collection, issns=None, output_file=None, years=6):
        self._articlemeta = utils.articlemeta_server()
        self._publicationstats = utils.publicationstats_server()
        self._analytics = Analytics()
        self.collection = collection
        self.issns = issns
        self._years = years
        self._lines = []
        self.output_file = codecs.open(output_file, 'w', encoding='utf-8') if output_file else output_file
        now = datetime.date.today().year
        self.years_range = [i for i in range(now, now-self._years, -1)]
        header = []
        header.append(u"extraction date")
        header.append(u"study unit")
        header.append(u"collection")
        header.append(u"ISSN SciELO")
        header.append(u"ISSN\'s")
        header.append(u"title at SciELO")
        header.append(u"title thematic areas")
        for area in choices.THEMATIC_AREAS:
            header.append(u"title is %s" % area.lower())
        header.append(u"title is multidisciplinary")
        header.append(u"title current status")
        header.append(u"title + subtitle SciELO")
        header.append(u"short title SciELO")
        header.append(u"short title ISO")
        header.append(u"title PubMed")
        header.append(u"publisher name")
        header.append(u"use license")
        header.append(u"alpha frequency")
        header.append(u"numeric frequency (in months)")
        header.append(u"inclusion year at SciELO")
        header.append(u"stopping year at SciELO")
        header.append(u"stopping reason")
        header.append(u"date of the first document")
        header.append(u"volume of the first document")
        header.append(u"issue of the first document")
        header.append(u"date of the last document")
        header.append(u"volume of the last document")
        header.append(u"issue of the last document")
        header.append(u"total of issues")
        header += [u"issues at %s" % str(i) for i in self.years_range]
        header.append(u"total of regular issues")
        header += [u"regular issues at %s" % str(i) for i in self.years_range]
        header.append(u"total of documents")
        header += [u"documents at %s" % str(i) for i in self.years_range]
        header.append(u"citable documents")
        header += [u"citable documents at %s" % str(i) for i in self.years_range]
        for year in self.years_range:
            header.append(u'portuguese documents at %s ' % year)
        for year in self.years_range:
            header.append(u'spanish documents at %s ' % year)
        for year in self.years_range:
            header.append(u'english documents at %s ' % year)
        for year in self.years_range:
            header.append(u'other language documents at %s ' % year)
        for year in self.years_range:
            header.append(u'google scholar h5 %s ' % year)
        for year in self.years_range:
            header.append(u'google scholar m5 %s ' % year)

        self.write(u','.join([u'"%s"' % i.replace(u'"', u'""') for i in header]))
Ejemplo n.º 7
0
    def test_compute_first_included_document_by_journal(self):
        publicationtats = publicationstats_server()

        query_result = {
            "hits": {
                "hits": [
                    {
                        "sort": [
                            "2003"
                        ],
                        "_type": "article",
                        "_index": "publication",
                        "_score": None,
                        "_source": {
                            "pid": "S1678-53202003000100002",
                            "creation_date": "2011",
                            "id": "scl_S1678-53202003000100002",
                            "creation_year": "2011",
                            "languages": [
                                "pt"
                            ],
                            "citations": 0,
                            "issue": "scl_S1678-532020030001",
                            "doi_prefix": "10.1590",
                            "journal_title": "ARS (S\u00e3o Paulo)",
                            "collection": "scl",
                            "authors": 1,
                            "publication_date": "2003",
                            "document_type": "research-article",
                            "pages": 1,
                            "processing_date": "2011",
                            "doi": "10.1590/S1678-53202003000100002",
                            "license": "by-nc/4.0",
                            "processing_year": "2011",
                            "subject_areas": [
                                "Linguistics, Letters and Arts"
                            ],
                            "issn": "1678-5320",
                            "publication_year": "2003",
                            "aff_countries": [
                                "undefined"
                            ]
                        },
                        "_id": "scl_S1678-53202003000100002"
                    }
                ],
                "total": 220,
                "max_score": None
            },
            "took": 94,
            "timed_out": False,
            "_shards": {
                "successful": 5,
                "failed": 0,
                "total": 5
            }
        }

        expected = {
            "pid": "S1678-53202003000100002",
            "creation_date": "2011",
            "id": "scl_S1678-53202003000100002",
            "creation_year": "2011",
            "languages": [
                "pt"
            ],
            "citations": 0,
            "issue": "scl_S1678-532020030001",
            "doi_prefix": "10.1590",
            "journal_title": "ARS (S\u00e3o Paulo)",
            "collection": "scl",
            "authors": 1,
            "publication_date": "2003",
            "document_type": "research-article",
            "pages": 1,
            "processing_date": "2011",
            "doi": "10.1590/S1678-53202003000100002",
            "license": "by-nc/4.0",
            "processing_year": "2011",
            "subject_areas": [
                "Linguistics, Letters and Arts"
            ],
            "issn": "1678-5320",
            "publication_year": "2003",
            "aff_countries": [
                "undefined"
            ]
        }

        result = publicationtats._compute_last_included_document_by_journal(query_result)

        self.assertEqual(expected, result)
Ejemplo n.º 8
0
    def test_compute_first_included_document_by_journal(self):
        publicationtats = publicationstats_server()

        query_result = {
            "hits": {
                "hits": [{
                    "sort": ["2003"],
                    "_type": "article",
                    "_index": "publication",
                    "_score": None,
                    "_source": {
                        "pid": "S1678-53202003000100002",
                        "creation_date": "2011",
                        "id": "scl_S1678-53202003000100002",
                        "creation_year": "2011",
                        "languages": ["pt"],
                        "citations": 0,
                        "issue": "scl_S1678-532020030001",
                        "doi_prefix": "10.1590",
                        "journal_title": "ARS (S\u00e3o Paulo)",
                        "collection": "scl",
                        "authors": 1,
                        "publication_date": "2003",
                        "document_type": "research-article",
                        "pages": 1,
                        "processing_date": "2011",
                        "doi": "10.1590/S1678-53202003000100002",
                        "license": "by-nc/4.0",
                        "processing_year": "2011",
                        "subject_areas": ["Linguistics, Letters and Arts"],
                        "issn": "1678-5320",
                        "publication_year": "2003",
                        "aff_countries": ["undefined"]
                    },
                    "_id": "scl_S1678-53202003000100002"
                }],
                "total":
                220,
                "max_score":
                None
            },
            "took": 94,
            "timed_out": False,
            "_shards": {
                "successful": 5,
                "failed": 0,
                "total": 5
            }
        }

        expected = {
            "pid": "S1678-53202003000100002",
            "creation_date": "2011",
            "id": "scl_S1678-53202003000100002",
            "creation_year": "2011",
            "languages": ["pt"],
            "citations": 0,
            "issue": "scl_S1678-532020030001",
            "doi_prefix": "10.1590",
            "journal_title": "ARS (S\u00e3o Paulo)",
            "collection": "scl",
            "authors": 1,
            "publication_date": "2003",
            "document_type": "research-article",
            "pages": 1,
            "processing_date": "2011",
            "doi": "10.1590/S1678-53202003000100002",
            "license": "by-nc/4.0",
            "processing_year": "2011",
            "subject_areas": ["Linguistics, Letters and Arts"],
            "issn": "1678-5320",
            "publication_year": "2003",
            "aff_countries": ["undefined"]
        }

        result = publicationtats._compute_last_included_document_by_journal(
            query_result)

        self.assertEqual(expected, result)