Home Articles Books Search About
RSS 日本語

Latest Articles

Checking ORCID RDF Data

Checking ORCID RDF Data

Here is how to check the RDF data of ORCID. The following ORCID ID is used as the target. https://orcid.org/0000-0001-8245-7925 For browsing, I use the Linked Data Browser developed by Masahide Kanzaki. https://www.kanzaki.com/works/2014/pub/ld-browser For example, you can browse the RDF data from the following URL. https://www.kanzaki.com/works/2014/pub/ld-browser?u=https%3A%2F%2Forcid.org%2F0000-0001-8245-7925 The specific RDF data is as follows. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:pav="http://purl.org/pav/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:gn="http://www.geonames.org/ontology#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:xsd="http://www.w3.org/2001/XMLSchema#"> <foaf:PersonalProfileDocument rdf:about="http://pub.orcid.org/orcid-pub-web/experimental_rdf_v1/0000-0001-8245-7925"> <pav:createdOn rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" >2017-07-14T00:27:17.421Z</pav:createdOn> <prov:generatedAtTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" >2022-12-14T02:40:04.693Z</prov:generatedAtTime> <pav:lastUpdateOn rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime" >2022-12-14T02:40:04.693Z</pav:lastUpdateOn> <pav:createdWith rdf:resource="https://orcid.org"/> <prov:wasAttributedTo> <prov:Person rdf:about="https://orcid.org/0000-0001-8245-7925"> <foaf:account> <foaf:OnlineAccount rdf:about="https://orcid.org/0000-0001-8245-7925#orcid-id"> <rdfs:label>0000-0001-8245-7925</rdfs:label> <foaf:accountName>0000-0001-8245-7925</foaf:accountName> <foaf:accountServiceHomepage rdf:resource="https://orcid.org"/> </foaf:OnlineAccount> </foaf:account> <foaf:publications> <foaf:Document rdf:about="https://orcid.org/0000-0001-8245-7925#workspace-works"/> </foaf:publications> <foaf:page rdf:resource="https://researchmap.jp/nakamura.satoru/?lang=english"/> <foaf:based_near> <gn:Feature> <gn:parentCountry> <rdf:Description rdf:about="http://sws.geonames.org/1861060/"> <gn:name>Japan</gn:name> <gn:countryCode>JP</gn:countryCode> <rdfs:label>Japan</rdfs:label> </rdf:Description> </gn:parentCountry> <gn:countryCode>JP</gn:countryCode> </gn:Feature> </foaf:based_near> <foaf:familyName>Nakamura</foaf:familyName> <foaf:givenName>Satoru</foaf:givenName> <rdfs:label>Satoru Nakamura</rdfs:label> <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/> </prov:Person> </prov:wasAttributedTo> <pav:createdBy rdf:resource="https://orcid.org/0000-0001-8245-7925"/> <foaf:maker rdf:resource="https://orcid.org/0000-0001-8245-7925"/> <foaf:primaryTopic rdf:resource="https://orcid.org/0000-0001-8245-7925"/> </foaf:PersonalProfileDocument> </rdf:RDF> I hope this is helpful as a reference. ...

Drupal: Creating Custom REST Resources

Drupal: Creating Custom REST Resources

Overview I created a custom REST resource by following the instructions below. https://www.drupal.org/docs/drupal-apis/restful-web-services-api/custom-rest-resources By following the above article, I was able to obtain a JSON result from the following URL. /demo_rest_api/demo_resource { "message": "Hello, this is a rest service" } REST UI Module The above article included the following note: If you are using the REST UI contrib module, you should now be able to see it in the list of available endpoints and you should be able to configure the GET method. ...

Creating a Custom API Using Drupal's RESTful Views

Creating a Custom API Using Drupal's RESTful Views

Overview This is a memo about creating a custom API using Drupal’s RESTful Views, based on the following article. https://acret.jp/drupal/node/434 In addition to the content of the above article, I also describe how to configure pagination. Creating Views I followed the instructions on the site mentioned above. Enabling Pagination I referenced the following article. https://www.drupal.org/forum/support/post-installation/2015-12-04/rest-export-pagination Select the Views Pager. I set it to Full as shown below. Mini also seemed to work fine. ...

Displaying the Total Number of Results in Drupal Views

Displaying the Total Number of Results in Drupal Views

Overview I looked into how to display the total number of results in Drupal Views, so here is a quick note. The total number of search results is displayed as shown below: Method I referenced the following article: https://ostraining.com/blog/drupal/count-views/ Access the following page: /admin/structure/views/view/content Click the Add button next to Header. Select “Result summary”. Click Apply, then click Save. Summary I hope this serves as a useful reference. ...

Adding Google Analytics 4 gtag.js to Omeka S

Adding Google Analytics 4 gtag.js to Omeka S

Overview The following module is available for setting up Google Analytics in Omeka S. https://omeka.org/s/modules/GoogleAnalytics/ As of April 2023, the above module also supports GA4, but as of April 2022, it was not supported as mentioned in the following post. https://forum.omeka.org/t/google-analytics-4-gtag-js/15034 Therefore, the following module was introduced, and I decided to try it. https://omeka.org/s/modules/AnalyticsSnippet/ Note that, as mentioned above, as of April 2023, the first module also supports GA4, so either module can be used for setting up Google Analytics. ...

Converting TEI XML to LaTeX Using TEI Critical Apparatus Toolbox

Converting TEI XML to LaTeX Using TEI Critical Apparatus Toolbox

Overview TEI Critical Apparatus Toolbox is “a tool for people preparing a natively digital TEI critical edition.” http://teicat.huma-num.fr/index.php In addition to providing functionality for visualizing critical apparatus information, it offers several other useful features. Among these, I learned that it has a “TEI to LaTeX and PDF conversion” feature, so I decided to try it out. Print an edition Access the following URL. http://teicat.huma-num.fr/print.php Click the link with the text this dummy edition file to download the following sample data. ...

Prototype of an XML File Validation Tool Using JPCOAR Schema (v1)

Prototype of an XML File Validation Tool Using JPCOAR Schema (v1)

I previously wrote the following article, where I tried validating XML files using the JPCOAR schema. This time, based on the verification from the above article, I created a validation tool using Google Colab. You can try it at the following URL. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/JPCOARスキーマ_v1を用いたxmlファイルのバリデーション.ipynb You can validate target files by specifying the URL of a published XML file or by uploading a local file. I hope this serves as a helpful reference when creating XML files using the JPCOAR Schema (v1). ...

Text Selection Using VueUse (Nuxt 3)

Text Selection Using VueUse (Nuxt 3)

Overview This is a personal note on using VueUse for implementing text selection functionality with Nuxt 3 (Vue 3). https://vueuse.org/ Demo You can try it from the following page. https://nuxt3-demo-git-main-nakamura196.vercel.app/textSelection The source code is at the following URL. https://github.com/nakamura196/nuxt3-demo/blob/main/pages/textSelection.vue Installation Method The installation instructions are described on the following page. https://vueuse.org/guide/ The specific steps are as follows. npm i -D @vueuse/nuxt @vueuse/core // nuxt.config.ts export default defineNuxtConfig({ modules: [ '@vueuse/nuxt', ], }) Summary In addition to text selection, there seem to be many other useful features available, so I would like to continue trying them out. ...

Search Using Drupal Search API in Next.js for Drupal (Faceted Search, etc.)

Search Using Drupal Search API in Next.js for Drupal (Faceted Search, etc.)

Overview I tried Next.js for Drupal. https://next-drupal.org/ By following the “Get Started” guide, I was able to integrate Next.js with Drupal. https://next-drupal.org/learn/quick-start Additionally, the following article introduces an implementation example for faceted search. https://next-drupal.org/guides/search-api This article is my notes specifically on implementing the latter, faceted search. Search API Create a Server and index as follows. The official site provides the following as a reference: https://www.drupal.org/docs/contributed-modules/search-api For a Japanese-language reference: https://www.acquia.com/jp/blog/introduction-to-search-api-1 ...

Does Contentful Full-Text Search Require Search Terms of 2 or More Characters?

Does Contentful Full-Text Search Require Search Terms of 2 or More Characters?

I am using Contentful, and it appears that search terms of 2 or more characters are required. A query will ignore search tokens with less than 2 characters. https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters/full-text-search-on-a-field This point requires attention when dealing with data that includes Japanese and other languages. Addendum With microCMS, searching from 1 character was possible. https://microcms.io/

How to Bulk Delete Content in Drupal

How to Bulk Delete Content in Drupal

Overview I looked into how to bulk delete content in Drupal, so this is a memo. The following article was helpful. https://www.webwash.net/how-to-bulk-delete-content-in-drupal/ The following three methods were introduced. Using Drupal Core UI Using Drush Using Drupal Views Bulk Operations (VBO) Using Drupal Core UI The following is a translation of the original description. If you have a small Drupal site and fewer than about 300 nodes to delete, you should use this method. This is because the Drupal Core UI only allows deleting 50 nodes at a time by default. As the site grows larger, this becomes tedious. ...

Connecting Drupal with Amazon OpenSearch Service

Connecting Drupal with Amazon OpenSearch Service

Overview I had the opportunity to connect Drupal with Amazon OpenSearch Service, so this is a personal note for future reference. The following article was helpful. https://www.acquia.com/jp/blog/intergration-with-drupal-and-elasticsearch Module Installation In addition to drupal/search_api and drupal/elasticsearch_connector, it was necessary to install nodespark/des-connector. (There may be room for improvement in how version specifications are handled.) composer require "nodespark/des-connector:^7.x-dev" composer require 'drupal/search_api:^1.29' composer require "drupal/elasticsearch_connector ^7.0@alpha" Then, enable them with the following. drush pm:enable search_api elasticsearch_connector Connecting Drupal to Elasticsearch Cluster Access the following. ...

Trying GraphQL with Drupal

Trying GraphQL with Drupal

Overview I tried GraphQL with Drupal, so this is a personal note for future reference. The following document was helpful. https://drupal-graphql.gitbook.io/graphql/ This assumes Drupal installed on Amazon Lightsail. Module Installation Install the following module. https://www.drupal.org/project/graphql However, it was necessary to install the following module beforehand. https://www.drupal.org/project/typed_data As a result, the installation was completed with the following commands. cd /home/bitnami/stack/drupal composer require 'drupal/typed_data:^1.0@beta' composer require 'drupal/graphql:^4.4' Module Installation from GUI I checked all three related modules below and installed them. ...

Adding GraphQL to Strapi

Adding GraphQL to Strapi

Overview In the following article, I launched Strapi on Amazon Lightsail. This time, I add GraphQL and try using it. Installing the GraphQL Plugin I ran the following. Please adjust paths like backend as needed. cd /opt/bitnami/apache2/htdocs/backend yarn add @strapi/plugin-graphql Then, start the application. yarn develop Accessing /graphql displays the following screen. I had already created a content type called services with a field called title. So by issuing the following query, I was able to retrieve the list and metadata. ...

Bug Fixes and Feature Additions to the NDL Classical Book OCR Tutorial Using Google Colab

Bug Fixes and Feature Additions to the NDL Classical Book OCR Tutorial Using Google Colab

Overview I have been creating a tutorial for the NDL “Classical Book” OCR application using Google Colab, as introduced in the following article. This time, the following updates were made. Added terms of use Fixed bugs Added support for IIIF Presentation API v3 manifest file input The updated notebook can be accessed at the same URL as before. https://colab.research.google.com/github/nakamura196/ndl_ocr/blob/main/NDL古典籍OCRの実行例.ipynb Terms of Use Please use the notebook itself under CC0. However, the “NDL Classical Book OCR Application” is released by the National Diet Library under the CC BY 4.0 license, so please include the appropriate credit. Also, please check the terms of use for the materials to which OCR is applied. ...

Creating IIIF Presentation API v3 Manifest Files Using Omeka S

Creating IIIF Presentation API v3 Manifest Files Using Omeka S

Overview I needed to create IIIF Presentation API v3 manifest files, so I will introduce how to create them using Omeka S. Installing Omeka S and the IIIF Server Module Please install by referring to the following resource. https://zenn.dev/nakamura196/books/f4f87f9730e12e Creating Items in Omeka S This time, we will use the following image published by the National Diet Library. https://dl.ndl.go.jp/api/iiif/2585098/R0000003/full/full/0/default.jpg Create a new item and give it an appropriate title. ...

Registering Taxonomies and Adding Them to Content in Drupal Using Python

Registering Taxonomies and Adding Them to Content in Drupal Using Python

Overview This is a continuation of the following series. This time, we will register taxonomies and add them to content. Registering Taxonomies A taxonomy called ne_class was created in advance through the GUI. It can be listed at the following URL. /jsonapi/taxonomy_term/ne_class Below is the program for registering a new taxonomy. Please configure host, username, and password as appropriate. payload = { "data": { "type": "taxonomy_term--ne_class", "attributes": { "name": "干瀬", } } } _type = "ne_class" url = f"{host}/jsonapi/taxonomy_term/{_type}" r = requests.post(url, headers=headers, auth=(username, password), json=payload) r.json() The following result is obtained. ...

Updating and Deleting Drupal Content Using Python

Updating and Deleting Drupal Content Using Python

Overview In the following article, I described how to create new content. This time, I’ll try updating and deleting existing content. Filtering Items With the following program, you can retrieve registered content. This time, I retrieved content with the title “Pre-update title.” res["data"] is an array. username = "xxx" password = "xxx" host = "xxx" query = { "title": "更新前のタイトル" } item_type = "article" filters = [] for key, value in query.items(): filters.append(f'filter[{key}]={value}') filter_str = '&'.join(filters) endpoint = f'{host}/jsonapi/node/{item_type}?{filter_str}' r = requests.get(endpoint, headers=headers, auth=(username, password)) res = r.json() len(res['data']) Getting the ID of the Content to Update An ID like 730f844d-b476-4485-8957-c33fccb7f8ac is obtained. ...

Adding Content to Drupal Using Python

Adding Content to Drupal Using Python

Overview I had an opportunity to add content to Drupal using Python, so this is a memo of the process. I referenced the following article. https://weimingchenzero.medium.com/use-python-to-call-drupal-9-core-restful-api-to-create-new-content-9f3fa8628ab4 Preparing Drupal I set it up on Amazon Lightsail. The following article is a useful reference. https://annai.co.jp/article/use-aws-lightsail Modules Install the following modules. HTTP Basic Auth JSON:API RESTful Web Services Serialization Changing JSON:API Settings Access the following page to change the settings. </admin/config/services/jsonapi> Python Set {IP address or domain name} and {password} as appropriate. ...

Running Strapi on Amazon Lightsail (SSL, Custom Domain)

Running Strapi on Amazon Lightsail (SSL, Custom Domain)

Overview I had the opportunity to run Strapi on Amazon Lightsail, so here are my notes. I referenced the following article: https://zenn.dev/holykzm/articles/1e54cc25207657 Instance Select Node.js. Choose an instance with at least 1GB of memory. If you build on Lightsail, an out-of-memory error will occur with less. SSL and Custom Domain Please refer to the following: https://zenn.dev/nakamura196/articles/5772d6c918508a#独自ドメインの付与 Assign a Static IP, configure a custom domain in Route 53, and run the following: ...