Explain the Cayley data format - graph-databases

Where can I find a reference of the Cayley database format? I find it confusing.
For example in the demo database of movie info, why do so many values start with "/en"?
Why does the following row have '/film' twice and why is there a dot at the end?
":/en/the_window" "/film/film/starring" ":53570" .
Why does Stephen Fry appear so many times?

The example cayley's database of movies is part of Freebase, so is using the freebase name convention.
The id property follow the rule:
/en - top level namespace for all human readable IDs
In the case of film/film/starring the first film is a common domain, the second one is the object and the third one is the name of the property.
You can read more at the page namespace in freebase wiki

Related

How to find the pointer node of a relationship using full text search on the edge node in neo4j

This question is related to Neo4j databases. Suppose I have a relationship (employee)-[WORKS-IN]->(company).. Imagine an employee works in multiple companies. I should be able to find the companies that a specific employee is working using full text search in neo4j. I'll be searching from the users name and I should be able to return company nodes..how to do that??
Full text search must be used.
So you want to search for a Person by name with full text and then retrieve the companies he worked for.
Compare this easily with the default Movies graph in Neo4j, you want to search for a Person by name with full text and then retrieve the movies the person acted in .
CALL db.index.fulltext.queryNodes('Person', 'kea*')
YIELD node
MATCH (node)-[:ACTED_IN]->(movie)
RETURN node.name, movie.title
This is an example when I created this node:
CREATE (e:Employee {name: 'Nirmana Testing'})
Then create the full text index on Employee.name
CREATE FULLTEXT INDEX employeeNameIdx FOR (e:Employee) ON EACH [e.name]
Then run a query using this full text index. Noted that the keyword 'nirmana' can be upper case or any case.
CALL db.index.fulltext.queryNodes("employeeNameIdx", "nirmana") YIELD node as employee
MATCH (employee)-[:WORKS-IN]->(company:Company)
RETURN employee, company
reference:
https://neo4j.com/docs/cypher-manual/current/indexes-for-full-text-search/
Thank you very much. Sorted it out. And one more thing. Suppose for a particular worker there can be various relationships except [WORKS-IN] , such as [PART TIME WORKER] , [FREELANCER], [PROJECT MANAGER] and so on. So for a particular user, If we want to find the place or company that he is working, freelancing, managing projects by searching the relationship type how could it be done using full text search.

How can I combine nominal data on SPSS?

I am doing my dissertation about brand recall. I created on spss a variable with the brands that the respondents recalled first (eg: 1 = "Facebook", 2="Instagram" and so on). I also created a variable with the brands that the respondents recalled in second place (1= "Facebook" and so on). I want to combine those two variables into one, in order to have only one variable called "brand recall". However, I don't know how to do it. Basically, when I sent the questionnaire to the respondents they mentioned more than one brand in their answers. I don't know how to combine all those answers into one in spss.
You can't do this because you will alter the data. From what I read you have a ranking question or a multiple answear question.
The first variables is for the FIRST brand recalled
The second variables if for the SECOND brand recalled.
Imagine that you want the answer gave in second variable aka second brand to be moved in the first variable. How will you make difference what was the first brand recalled and second brand recalled.
Another thing. If a respondent selected Facebook as first brand(in the first variable) in the second option Facebook was showed/you have the possibility to select it again? If that's the case this is not ok. Imagine that I can select Facebook in first brand recalled and also in the second one.
Give more details and maybe I can help you
Well if it's an open-ended question you can do a basic coding of that OE question and it goes like this:
1.run a basic frequency of the open-end question. example: fre [Open-end question].
2.after you see what answers you have like Facebook, Twitter etc. will have an overview of what brands were mentioned.
Create a numeric variable named brands. example: numeric brands (f2.0) assuming that you have more than 10 individual brands mentioned in the open-end. In case you have more than 100 brands mentioned write (f3.0).
Add value labels for the newly created brands variable. example:
value labels brands
1"Facebook"
2"Instagram"
3"Twitter"
4"[Any other brands mentioned".(very important to have . at the last value label code added)
after you created the variable and added all the brands as value labels/answear options the recode part start:
if [Open-end question]="the exact wording" brands=[select what answear option].
exe.
Example:
if [open-end question]="IG" brands=2. Respondent referred to Instagram.
if [open-end question]="Faaacebook" brands=1. Respondent referred to Facebook.
.
.
.
exe. (do not forget to add at the end .exe in order to run the syntax code)
After you populated the brand variable run a simple frequency to see how many mentions you have.
Hope this answers helps.

Show UniData SELECT results that are not record keys

I'm looking over some UniData fields for distinct values but I'm hoping to find a simpler way of doing it. The values aren't keys to anything so right now I'm selecting the records I'm interested in and selecting the data I need with SAVING UNIQUE. The problem is, in order to see what I have all I know to do is save it out to a savedlist and then read through the savedlist file I created.
Is there a way to see the contents of a select without running it against a file?
If you are just wanted to visually look over the data, use LIST instead of SELECT.
The general syntax of the command is something like:
LIST filename WITH [criteria] [sort] [attributes | ALL]
So let's say you have a table called questions and want to look over all the author for questions that used the tag unidata. Your query might look something like:
LIST questions WITH tag = "unidata" BY author author
Note: The second author isn't a mistake, it's the start of the list of attributes you want displayed - in this case just author, but you might want the record id as well, so you could do #ID author instead. Or just do ALL to display everything in each record.
I did BY author here as it will make spotting uniques easier, but you can also use other query features like BREAK.ON to help here as well.
I don't know why I didn't think of it at the time but I basically needed something like SQL's DISTINCT statement since I just needed to view the unique values. Replicating DISTINCT in UniData is explained here, https://forum.precisonline.com/index.php?topic=318.0.
The trick is to sort on the values using BY, get a single unique value of each using BREAK-ON, and then suppress everything except those unique values using DET-SUP.
LIST BUILDINGS BY CITY BREAK-ON CITY DET-SUP
CITY.............
Albuquerque
Arlington
Ashland
Clinton
Franklin
Greenville
Madison
Milton
Springfield
Washington

Working with columns having dot(.) in their name using GQL

I use Objectify for datastore operations in my GAE/Java application. I have used Objectify's #Embeded facility in a couple of places in my project. Objectify automatically flattens the nested objects within the entity marked by #Embeded notation using the . separator. Thus I have ended up with column names like entity.embededObject.Field
For example I have an entity 'Person' in my data store with two columns name and address.email.
I want to filter through Person in the datastore viewer by writing a simple GQL query.
But the following query fails with a syntax error:
SELECT * FROM Person where address.email='mail#gmail.com'
whereas the following works as it should
SELECT * FROM Person where name='Joe'
What am I doing wrong?
GQL currently doesn't support this - only 'word' characters are supported. You should definitely file this as a bug in the issue tracker.
Tested today, it is possible to run the following with backquotes
SELECT * FROM `your.kind`
I believe this holds true for any parameter, but please correct me if I am wrong.

Rename field using Objectify and Google App Engine

I am trying a case where we changed a field name in our entity. we have something like this for example
class Person {
String name; //The original declaration was "String fullName"
}
According to objectify you have to use annonation #AutoLoad(""). This is ok and it works as Google Datastore doesn't delete the data Actually but it makes a new field so this annotation is like a mapping between the old and the new field. No problem when you are reading the whole table.
The problem arises when you apply a filter on your query (Suppose you made 5 objects with old name and 5 with new name). The result of your query depends on whether you used the old variable name or the new one (returns back only 5 but never the 10). It won't fetch both of them and map them. Any Suggestions for this problem? I hope i explained it in a clear way.
Thanks in advance
The simplest straight forward solution. fetch all data with the annonation "AutoLoad()". Then store them again. In this way they will be saved as the new field. The old one doesn't exist anymore or at least it doesn't contain any data anymore. It is like migrating the data from the old name to the new name. Anyone has better suggestions ?
If you've changed the name of your field, you need to load and re-put all your data (using the mapreduce API would be one option here). There's no magic way around this - the data you've stored exists with two different names on disk.
You can use #OldName
http://www.mail-archive.com/google-appengine-java#googlegroups.com/msg05586.html

Resources