How to extract person's last name from Wikidata database? - data-extraction

Here is the page for Albert Einstein in Wikidata:
https://www.wikidata.org/wiki/Q937
I can't see any property for his last name (which is "Einstein") here and do you?
How to extract person's last name from this database?

On Wikidata, to extract a person's family name, you have to look for an item's statements which are using property P734 (Family Name). P734 is a property only allowing values pointing to other items. So the statement's value will be another item, representing the family name. The family name as a string can then be extracted from that item's label.
In the case of Q937 (Albert Einstein), the family name is Q16834800 (Einstein).

Related

Create new column based on specific cell value

I need to create a new column containing repeatedly a specific cell value.
In Column1, Row1 the table contains the exam name. Lets say "Exam1". I now need a new column with this text value "Exam1" for all of my students. The new columns name would then be "Exam-Name" and all the rows should have as content the exam name "Exam1".
How can I reference to a specific content in a specific cell and have this text as value for all of my rows in a new column?
Concrete: I need the value "MMA20aL..." to be the value in the row on the right where actually you find the contents "KE21a..."
Thank you for your help. I pretty new to PowerQuery, thank you for a detailed explanation :-)
If you right click the first cell and drill down it will show you a formula. Make note of that formula then remove the drill down step.
Add column ... custom column ... with column name Exam-Name and the formula it showed you, such as :
= Source{0}[Column1]
Where Source in above formula is the name of prior step and Column1 is the name of the first column
So, for example, if prior step is #"Changed Type" and the first column is named Bob then use instead
= #"Changed Type"{0}[Bob]
(As a note, your data is in a terrible format and needs much massaging before it would be really useful)

Change a field property in SNOW

I'm trying to change a field's default property in SNOW. Here in incidents we've a field Assigned to and it accepts some default values. But instead of that I want it to accept any values (Integer, String, Special characters etc). In my SNOW Form lay out tried the below.
Created a new String field, Named it as Assigned to Label and name as assigned_to and saved it and it ended up as shown below.
and when I added some random text in this field, it gave me the below error.
please let me know on how can I change this field to accept any string as Input.
Thanks
You are referencing the sys_user table on the form field Assigned to. You need to provide the value for the Assigned to field the sys_id from the User record.
Providing it with any text will result in an invalid reference since it is looking for the unique sys_id on the user table.

importing csv (magento)

I have a certain attribute dealer_country in my website, which is a dropdown attribute containing a list of all countries. However, in my csv file, the dealer_country attribute will be containing country codes(in 2-letter format). Would it be possible to import with this condition?
Yes. There is an easy way and a hard way.
If programming is your bag then you can get your attribute hooked up to the Magento country codes and have it return country names on the front end.
It would take a while to write such an ideal solution. However you can use a 3rd party import tool like 'Magmi' to get your products in without having to define your attribute values first.
Once in you can edit your attribute entries for country and, in the second column put the country names to be shown on the front end. e.g. for 'GB' in column one you have 'United Kingdom of Great Britain and Northern Ireland' in column two. Or for 'LY' you can add 'The Great Socialist People's Libyan Arab Jamahiriya' for column two... Oops!
http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Main_Page

How to properly organize search of the person?

Let's say I have list of persons in my datastore. Each person there may have the following fields:
last name (*)
first name
middle name
id (*)
driving licence id (*)
another id (*)
date of birth
region
place of birth
At least one of the fields marked with (*) must exist.
Now user provides me with the same list of fields (and again at least one of the fields marked with (*) must be provided). I should search for the person user provided. But not all fields should be matched. I should display to the user somehow how I am sure in the results of search. Something like:
if person matched by id and last name (and user provided just these 2 fields for the search), then I am sure that result is correct (100%);
if person matched by id and last name (and user provided other fields, which were found in the database, but were not matched), then I am sure that result is almost correct by 60%;
etc.
(numbers are provided just as example)
How can I organize such search? Is there any standard algorithm? I also would like to minimize number of requests to the database.
P.S. I can not provide user with the actual field values from the database.
It sounds like your logic for determining the quality of a match will be too complex to handle at the database layer. I think you'll get the best performance by retrieving all of the records that match at least one of the mandatory keys, calculating the match score for each of them in memory, and returning the best score. For example, if the user provides you with an id, last name and place of birth, your query would look something like:
SELECT * FROM users WHERE id = `the_id` OR last_name = `the_last_name`;
This could be a performance problem if you have a VERY large dataset with lots of common last names but otherwise I would expect not to see too many collisions. You can check this on your own dataset outside of GAE. You could also get better performance if all mandatory fields MUST match by changing the OR to an AND.

How to fetch data from a text file to a vb6 form

I have a text file in which the names of the students occur at various places. There is the text "names" and then the name of one student following it. Similarly, at another place this text, "Names" appears with the name of the student following it.
I want to fetch the name of the student one by one. That is, the first name is to be fetched and then I do some operations. Then after these operations I have to fetch another name and repeat the same operations.
How do I fetch the name of the student one by one and put them in the text box located in the vb6 form?
How to read a text file line by line:
http://www.dreamincode.net/code/snippet318.htm
Look at using InStr to find a value in the string read in.
http://www.aivosto.com/vbtips/instr.html

Resources