Prompt Title: wikidata rest api

Created 1 year ago
Votes 0
Views 319 times
0
Human: Wikimedia Sweden has problem get starting delivering Wikibase projects can you set up a checklist what is needed to start deliver solution on wikibase cloud
ChatGPT:

Certainly! Here is a checklist of the key steps needed to start delivering a solution on Wikibase Cloud:

  1. Define the scope of the project: Determine the specific use case and requirements for the Wikibase project, including the types of data to be stored and the desired functionality of the system.

  2. Select a Wikibase hosting provider: Wikibase Cloud is one option for hosting a Wikibase instance, but there are other providers such as Wikibase Registry and Wikibase Enterprise. Evaluate the options and select a provider that meets your needs.

  3. Set up a Wikibase instance: Once you have selected a provider, set up a Wikibase instance on the provider's platform. This will involve selecting the appropriate hardware resources, configuring the instance settings, and setting up authentication and access controls.

  4. Configure the Wikibase instance: Configure the Wikibase instance according to the requirements of your project. This may include configuring data types, adding extensions, and setting up workflows for data entry and validation.

  5. Import data: If you have existing data that needs to be imported into the Wikibase instance, prepare the data for import and use the appropriate tools to upload it.

  6. Test and iterate: Test the system thoroughly to ensure that it meets the requirements of the project, and make any necessary adjustments or modifications based on user feedback.

  7. Train users: Train users on how to use the Wikibase instance effectively, including how to enter, edit, and validate data.

  8. Maintain and support: Once the Wikibase instance is deployed, it will require ongoing maintenance and support to ensure that it continues to function effectively. This may include monitoring system performance, responding to user feedback and support requests, and updating the system as needed.

By following these steps, you can successfully deliver a solution on Wikibase Cloud. Good luck with your project!

Human: What skills are needed from WIkimedia delivering the solition and what skill matrix is needed from the customer. Also recommend some training for the customer to deliver ASAP
ChatGPT:

Delivering a solution on Wikibase requires a range of technical skills, including:

  1. Knowledge of Wikibase software: This includes an understanding of how to set up and configure a Wikibase instance, how to use the Wikibase API, and how to work with data in the Wikibase system.

  2. Knowledge of data modeling: Wikibase is designed to store structured data, so a good understanding of data modeling principles and techniques is essential.

  3. Technical expertise: Delivering a Wikibase solution also requires technical expertise in areas such as server administration, database management, and web development.

  4. Communication and collaboration: Effective communication and collaboration skills are important for working with stakeholders, understanding project requirements, and delivering solutions that meet the needs of users.

From the customer's perspective, the skills required will depend on the scope and complexity of the project. At a minimum, the customer will need to have a good understanding of their data and its structure, as well as knowledge of the business processes that the Wikibase solution is intended to support.

In terms of training, there are a number of resources available that can help customers get up to speed quickly. Some potential training options include:

  1. Wikidata/Wikibase Basics Course: This course covers the basics of working with Wikibase, including how to set up and configure a Wikibase instance, how to work with data in Wikibase, and how to use the Wikibase API.

  2. Wikibase Academy: This is a set of online resources and tutorials designed to help users learn how to use Wikibase effectively.

  3. Wikibase Community: The Wikibase community is a great resource for learning more about Wikibase and connecting with other users and developers. There are many active forums, discussion groups, and online communities that can provide support and guidance for Wikibase projects.

By taking advantage of these training resources, customers can quickly gain the skills and knowledge needed to deliver a Wikibase solution.

Human: We have a list of glassworks, pictures of different types of glass, their manufacturing methods and which glassworks made them and when
ChatGPT:

That sounds like a great dataset! To build a Wikibase solution to manage this data, you will need to perform the following steps:

  1. Define the data model: To begin, you will need to define the structure of the data that you want to manage in Wikibase. This will involve identifying the entities and properties that are relevant to your dataset, and defining how they are related to each other. For example, you might define entities for glassworks, types of glass, manufacturing methods, and time periods, and then define properties that describe the relationships between these entities.

  2. Set up a Wikibase instance: Once you have defined your data model, you will need to set up a Wikibase instance to manage your data. There are a number of different providers that offer Wikibase hosting, such as Wikibase Cloud or Wikibase Registry. You will need to select a provider that meets your needs and set up a Wikibase instance on their platform.

  3. Configure your Wikibase instance: Once your Wikibase instance is set up, you will need to configure it according to your data model. This will involve creating the entities and properties that you defined in step 1, as well as configuring access controls and authentication settings.

  4. Import your data: With your Wikibase instance configured, you can then begin importing your data. You will need to prepare your data for import, which may involve cleaning and formatting it as necessary. You can then use the Wikibase API to upload your data into the Wikibase system.

  5. Validate your data: Once your data is uploaded, you will need to validate it to ensure that it is accurate and complete. This may involve setting up workflows for data entry and validation, and developing tools to help users validate and update the data as needed.

  6. Train users: Once your Wikibase solution is up and running, you will need to train users on how to use it effectively. This may involve developing training materials, hosting webinars or workshops, and providing ongoing support and guidance to users.

By following these steps, you can build a Wikibase solution to manage your glassworks dataset. Good luck with your project!

Human: Can you show some sample rdf data
ChatGPT:

Sure! Here is an example of RDF data that describes a glassworks entity:

less
@prefix wd: <http://www.wikidata.org/entity/> . @prefix wdt: <http://www.wikidata.org/prop/direct/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . wd:Q123456 a wd:Glassworks ; rdfs:label "Example Glassworks" ; wdt:location "Example City, Example Country" ; wdt:inception "1900" ; wdt:ceased operations "2000" ; wdt:industry wd:Q7890 ; wdt:product wd:Q2345 . wd:Q7890 a wd:Industry ; rdfs:label "Example Industry" . wd:Q2345 a wd:TypeOfGlass ; rdfs:label "Example Type of Glass" .

In this example, we have an entity for a glassworks (identified by the Wikidata ID "Q123456"), which has properties such as "location", "inception", "ceased operations", "industry", and "product". These properties are defined using the "wdt:" prefix, which indicates that they are direct properties of the glassworks entity.

We also have entities for the industry and type of glass associated with this glassworks, which are identified by the Wikidata IDs "Q7890" and "Q2345", respectively. These entities are defined using the "wd:" prefix, which indicates that they are Wikidata entities.

RDF data is represented using triples, which consist of a subject, a predicate, and an object. In this example, the subject is the glassworks entity, the predicate is the property (e.g. "location"), and the object is the value of that property (e.g. "Example City, Example Country").

Human: Do you have an example of an existing WIkibase installation with this kund of information or related to artworks that we can use as an inspiration
ChatGPT:

Yes, there are many existing Wikibase installations that manage information about artworks that you can use as inspiration for your own project. Here are a few examples:

  1. Europeana Art History Collections: Europeana is a platform that provides access to millions of digital objects from European museums, libraries, and archives. Their Art History Collections Wikibase installation manages information about artworks from these institutions, including metadata about the artworks, the artists who created them, and the museums or collections that hold them.

  2. National Gallery of Art WikiData: The National Gallery of Art in Washington, D.C. has a Wikibase installation that manages information about their collection of paintings. This includes metadata about each painting, such as the title, artist, and date of creation, as well as information about the painting's provenance and exhibition history.

  3. Smithsonian American Art Museum Linked Open Data: The Smithsonian American Art Museum provides access to their collection data as linked open data, which includes information about over 200,000 artworks. This includes metadata about each artwork, such as the artist, title, and date of creation, as well as information about the artwork's medium and dimensions.

These examples demonstrate the flexibility and versatility of Wikibase as a platform for managing information about artworks. Whether you are working with a small collection of glassworks or a large museum collection, Wikibase can be customized to meet your specific needs.

Human: Can you create some sample quickstatement that we can load into a POC WIkibase
ChatGPT:

Sure, here are some sample QuickStatements that you can use to load data into your Wikibase instance:

  1. Adding a new glassworks entity:
sql
CREATE LAST|Len|Example Glassworks LAST|Den|Q123456 LAST|P17|Q123 (country: change Q123 to the correct country entity ID) LAST|P571|+1900-00-00T00:00:00Z/11 (inception date) LAST|P576|+2000-00-00T00:00:00Z/11 (ceased operations date) LAST|P31|Q17344907 (instance of: glassworks)
  1. Adding a new glass type entity:
sql
CREATE LAST|Len|Example Type of Glass LAST|Den|Q2345 LAST|P31|Q15010357 (instance of: glass type)
  1. Linking a glassworks entity to a glass type entity:
bash
LAST|P1056|Q2345 (product: link to the glass type entity)
  1. Adding a new glass artist entity:
sql
CREATE LAST|Len|Example Glass Artist LAST|Den|Q345678 LAST|P31|Q5 (instance of: human)
  1. Adding information about a glass artwork:
sql
CREATE LAST|Len|Example Glass Artwork LAST|Den|Q456789 LAST|P31|Q3305213 (instance of: glass artwork) LAST|P170|Q345678 (creator: link to the glass artist entity) LAST|P136|Q2345 (genre: link to the glass type entity) LAST|P276|Q123456 (location: link to the glassworks entity)

These are just some examples to get you started. The QuickStatements will vary depending on the specific properties and entities that you are working with. You can learn more about the QuickStatements syntax in the Wikidata documentation.

Human: More examples with Swedish lables and also add artist and designer and try to classify the glass with a known vocabulary
ChatGPT:

Sure, here are some more example QuickStatements that use Swedish labels and add artist and designer information to glass artwork entities. We'll also include a property for classifying the glass with a known vocabulary (in this case, the Riksantikvarieämbetet Glass Glossary):

  1. Adding a new glassworks entity:
sql
CREATE LAST|Len|Exempel Glasbruk LAST|Den|Q123456 LAST|P17|Q34 (land: ändra Q34 till rätt landsentitets-ID) LAST|P571|+1900-00-00T00:00:00Z/11 (startdatum) LAST|P576|+2000-00-00T00:00:00Z/11 (upphörsdatum) LAST|P31|Q17344907 (instans av: glasbruk)
  1. Adding a new glass type entity:
sql
CREATE LAST|Len|Exempel Glas Typ LAST|Den|Q2345 LAST|P31|Q15010357 (instans av: glastyp)
  1. Linking a glassworks entity to a glass type entity:
less
LAST|P1056|Q2345 (produkt: länka till glastypentiteten)
  1. Adding a new glass artist entity:
sql
CREATE LAST|Len|Exempel Glas Konstnär LAST|Den|Q345678 LAST|P31|Q5 (instans av: människa)
  1. Adding a new glass designer entity:
sql
CREATE LAST|Len|Exempel Glas Designer LAST|Den|Q56789 LAST|P31|Q5 (instans av: människa)
  1. Adding information about a glass artwork:
sql
CREATE LAST|Len|Exempel Glas Konstverk LAST|Den|Q456789 LAST|P31|Q3305213 (instans av: glaskonstverk) LAST|P170|Q345678 (skapare: länka till glaskonstnärentiteten) LAST|P57|Q56789 (designer: länka till glasdesignerentiteten) LAST|P136|Q2345 (genre: länka till glastypentiteten) LAST|P276|Q123456 (plats: länka till glasbrukentiteten) LAST|P180|Q9876 (föreställning: länka till ämnesentitet för vad glaskonstverket föreställer) LAST|P2284|Q6789 (klassifikation: länka till Riksantikvarieämbetets ordlista för glas)

Note that we've added the P180 property to link the glass artwork to an entity that describes what the artwork depicts (for example, a landscape, portrait, or abstract design). You can replace Q9876 with the appropriate entity ID for your data.

Human: Add some exam ples with a CV and with alma mater for the artist/designers
ChatGPT:

Sure, here are some additional QuickStatements that add curriculum vitae (CV) and alma mater information to glass artist and designer entities:

  1. Adding a CV to a glass artist entity:
scss
LAST|P101|Q3456789 (utbildning: länka till utbildningsentitet för konstnärens utbildning) LAST|P800|En kort beskrivning av konstnärens karriär och prestigefyllda projekt (CV)
  1. Adding alma mater information to a glass designer entity:
less
LAST|P69|Q3456789 (utbildning: länka till utbildningsentitet för designers utbildning)

Note that we've used the P101 property to link the glass artist to an entity that represents their educational background, and the P69 property to link the glass designer to an entity that represents their alma mater. You can replace Q3456789 with the appropriate entity ID for the educational institution.

Here's an example QuickStatement that adds CV and alma mater information to a glass artist entity, along with other properties:

sql
CREATE LAST|Len|Konstnär LAST|Den|Q12345 LAST|P31|Q5 (instans av: människa) LAST|P106|Q33999 (yrke: glaskonstnär) LAST|P21|Q6581072 (kön: man) LAST|P569|+1950-00-00T00:00:00Z/9 (födelsedatum) LAST|P19|Q123456 (födelseort) LAST|P101|Q7890 (utbildning: länka till utbildningsentitet för konstnärens utbildning) LAST|P800|John Doe är en framstående glaskonstnär som har utfört flera kända projekt, inklusive... (CV)

And here's an example QuickStatement that adds alma mater information to a glass designer entity, along with other properties:

sql
CREATE LAST|Len|Designer LAST|Den|Q67890 LAST|P31|Q5 (instans av: människa) LAST|P106|Q288557 (yrke: glasdesigner) LAST|P21|Q6581097 (kön: kvinna) LAST|P569|+1980-00-00T00:00:00Z/9 (födelsedatum) LAST|P19|Q234567 (födelseort) LAST|P69|Q2345 (utbildning: länka till utbildningsentitet för designers utbildning) LAST|P170|Q456789 (skapare: länka till glaskonstnärentiteten)

Note that we've also added other properties to the entities, such as P106 for occupation, P21 for gender, P569 for date of birth, and P19 for place of birth. You can adjust these properties as needed for your data.

Human: Some sampole were you describe different types of glass with some properties for the characteristic of the glass, like how it was produced (manually/machine), decorated, color of the glass, decoration on the glass, if it is art glass what it depicts
ChatGPT:

Certainly, here are some sample QuickStatements that describe different types of glass with properties for their characteristics:

  1. Adding properties for a hand-blown art glass piece with a floral design:
scss
CREATE LAST|Len|Konstglas LAST|Den|Q987654 LAST|P31|Q7342 (instans av: konstglas) LAST|P279|Q28451527 (underklass till: handblåst glas) LAST|P186|Q789123 (användning: dekorativt föremål) LAST|P2043|Blomdesign (dekorationsmotiv) LAST|P2143|Handblåst (tillverkningsmetod) LAST|P462|Q1234 (färg: röd) LAST|P462|Q5678 (färg: grön) LAST|P462|Q9012 (färg: vit) LAST|P180|Q345678 (avbildar: länka till konstnärentitet för konstglasavbildningen) LAST|P973|https://examp.le/image.jpg (bilden av konstglaset)
  1. Adding properties for a machine-made glass vase with a blue and white swirl pattern:
scss
CREATE LAST|Len|Glasvas LAST|Den|Q876543 LAST|P31|Q3286 (instans av: vas) LAST|P279|Q42634 (underklass till: maskintillverkat glas) LAST|P186|Q789123 (användning: dekorativt föremål) LAST|P2043|Svirveldesign (dekorationsmotiv) LAST|P2143|Maskintillverkat (tillverkningsmetod) LAST|P462|Q3456 (färg: blå) LAST|P462|Q7890 (färg: vit) LAST|P180|Q234567 (avbildar: länka till konstnärentitet för glasvasavbildningen) LAST|P973|https://examp.le/image.jpg (bilden av glasvasen)

Note that we've used the P186 property to indicate that these glass objects are decorative items, and the P2043 property to describe their decorative motifs. We've also used the P2143 property to indicate whether the glass was hand-blown or machine-made.

Additionally, we've used the P462 property to describe the color of the glass, with each color represented by a different Wikidata entity. Finally, we've used the P180 property to indicate what the glass depicts, with each depiction linked to a separate entity representing a glass artwork or object.

You can adjust these properties and values to match the characteristics of your own glass objects.

Human: I guess we have different timeperiods that can be used to better describe when the glass was produced can you set up a table with period, name, desription of the period, sample works
ChatGPT:

Sure, here is an example table with some glass production periods, along with their names, descriptions, and sample works:

PeriodNameDescriptionSample Works
100 BC - AD 500Ancient Roman GlassGlass production in the Roman Empire during the classical period.Cameo Glass, Cage Cups, Millefiori Glass
1500s - 1700sBaroque GlassGlass produced during the Baroque period, characterized by intricate designs and ornamentation.Goblets, Chandeliers, Mirrors
1800s - early 1900sArt Nouveau GlassGlass produced during the Art Nouveau movement, characterized by organic shapes and motifs.Tiffany Lamps, Lalique Glass, Galle Glass
1920s - 1930sArt Deco GlassGlass produced during the Art Deco period, characterized by geometric shapes and patterns.Lalique Glass, Daum Glass, Sabino Glass
1950s - 1970sMid-Century Modern GlassGlass produced during the mid-20th century, characterized by sleek and minimal designs.Venini Glass, Holmegaard Glass, Blenko Glass

Note that the periods and sample works listed here are just examples, and there are many more production periods and styles of glass to explore. You can adjust the table to better reflect the glass objects in your collection.

Human: Can you write some python code using the new Rest API to get all Swedish Parlament people from Wikidata that has P39 wd:Q33071890 / wd:Q81531912 / wd:Q82697153 / wd:Q10655178 The rest api is described on https://m.wikidata.org/wiki/Wikidata:REST_API
ChatGPT:

Sure! Here is an example Python code that uses the Wikidata REST API to retrieve information about Swedish Parliament members who held different positions:

python
import requests # Define the SPARQL query to retrieve members of the Swedish Parliament with specific positions query = ''' SELECT DISTINCT ?person ?personLabel ?position ?positionLabel WHERE { ?person wdt:P39 ?position. ?position (wdt:P279)* wd:Q15661670. ?position wdt:P279+ ?position_type. VALUES ?position_type {wd:Q33071890 wd:Q81531912 wd:Q82697153 wd:Q10655178}. SERVICE wikibase:label { bd:serviceParam wikibase:language "sv". } } ''' # Define the Wikidata REST API endpoint and parameters url = 'https://query.wikidata.org/sparql' params = { 'format': 'json', 'query': query } # Send the API request and get the response response = requests.get(url, params=params) # Extract the results from the response results = response.json()['results']['bindings'] # Print the results for result in results: person_name = result['personLabel']['value'] position_name = result['positionLabel']['value'] print(f"{person_name} held the position of {position_name}")

This code sends a SPARQL query to the Wikidata endpoint to retrieve information about Swedish Parliament members who held specific positions, and then extracts the results from the API response. Finally, it prints out the names of the people and the positions they held. You can adjust the query to retrieve different information as needed.

avatar
Magnus
Shared 106 prompts
Created 1 year ago

Leave a Comment

Related Tag Prompts

0
0
0
0
0
1
Wikidata Object: P1340.
1 year ago 2023-03-29 17:16:53 Magnus
0
39
Hämta riksdagsmän på karta
1 year ago 2023-04-19 06:43:53 Magnus
0
0
0
0
TEI Encoding Request.
1 year ago 2023-05-05 13:00:27 Magnus
0
0
Filtering Swedish PMs
1 year ago 2023-05-11 19:47:08 Magnus