Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rest-api-examples
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
snac
rest-api-examples
Commits
1f9cb3dc
Commit
1f9cb3dc
authored
Mar 02, 2017
by
Robbie Hott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added entity type to the queried Constellation
parent
e4c44282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
cbwcsv.php
reconciliation/cbw_example/cbwcsv.php
+7
-2
cbwhtml.php
reconciliation/cbw_example/cbwhtml.php
+3
-0
No files found.
reconciliation/cbw_example/cbwcsv.php
View file @
1f9cb3dc
...
...
@@ -27,6 +27,7 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
"Elastic75 Score"
,
"Original Length Score"
,
"Original Length Difference Score"
,
"Entity Type Filter Score"
,
"SNAC Degree Score"
);
fputcsv
(
STDOUT
,
$output
);
...
...
@@ -57,6 +58,9 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
"command"
=>
"reconcile"
,
"constellation"
=>
array
(
"dataType"
=>
"Constellation"
,
"entityType"
=>
array
(
"term"
=>
"person"
),
"nameEntries"
=>
array
(
array
(
"dataType"
=>
"NameEntry"
,
...
...
@@ -72,7 +76,7 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
// Use CURL to send reconciliation request to the REST API
$ch
=
curl_init
();
curl_setopt
(
$ch
,
CURLOPT_URL
,
"http://
snac-web.iath.virginia.edu:81
/"
);
curl_setopt
(
$ch
,
CURLOPT_URL
,
"http://
localhost/snac_server/rest
/"
);
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
array
(
'Content-Type: application/json'
,
...
...
@@ -83,7 +87,7 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
curl_setopt
(
$ch
,
CURLOPT_RETURNTRANSFER
,
true
);
$responseJSON
=
curl_exec
(
$ch
);
curl_close
(
$ch
);
// Decode JSON response into an Associative Array
$response
=
json_decode
(
$responseJSON
,
true
);
...
...
@@ -106,6 +110,7 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
isset
(
$result
[
'vector'
][
"ElasticSeventyFive"
])
?
$result
[
'vector'
][
"ElasticSeventyFive"
]
:
0
,
isset
(
$result
[
'vector'
][
"OriginalLength"
])
?
$result
[
'vector'
][
"OriginalLength"
]
:
0
,
isset
(
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:OriginalLengthDifference"
])
?
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:OriginalLengthDifference"
]
:
0
,
isset
(
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:EntityTypeFilter"
])
?
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:EntityTypeFilter"
]
:
0
,
isset
(
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:SNACDegree"
])
?
$result
[
'vector'
][
"MultiStage:ElasticNameOnly:SNACDegree"
]
:
0
);
fputcsv
(
STDOUT
,
$output
);
...
...
reconciliation/cbw_example/cbwhtml.php
View file @
1f9cb3dc
...
...
@@ -77,6 +77,9 @@ if (isset($argv[1]) && (($handle = fopen($argv[1], "r")) !== FALSE)) {
"command"
=>
"reconcile"
,
"constellation"
=>
array
(
"dataType"
=>
"Constellation"
,
"entityType"
=>
array
(
"term"
=>
"person"
),
"nameEntries"
=>
array
(
array
(
"dataType"
=>
"NameEntry"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment