This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gremlin> g = new OrientGraph("local:/tmp/orient") | |
==>orientgraph[local:/tmp/orient] | |
gremlin> g.createKeyIndex("list", Vertex.class) | |
==>null | |
gremlin> g.stopTransaction(SUCCESS) | |
==>null | |
gremlin> v1 = g.addVertex() | |
==>v[#6:-2] | |
gremlin> v2 = g.addVertex() | |
==>v[#6:-3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testVertexCountOnPreTransactionCommit() { | |
TransactionalGraph graph = (TransactionalGraph) graphTest.generateGraph(); | |
Vertex v1 = graph.addVertex(null); | |
graph.stopTransaction(Conclusion.SUCCESS); | |
vertexCount(graph, 1); | |
Vertex v2 = graph.addVertex(null); | |
Edge e = graph.addEdge(null, v1, v2, "friends"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select top 5000 p.provider_id | |
,p.provider_name_first, p.provider_name_last | |
,p.primary_addr_city, p.primary_addr_realm, p.primary_addr_zip | |
,round(p.provider_default_score*100,0) as iv_score | |
,round(msl.stat_rank*100,0) as msl_score | |
,'nationalTag' = case | |
when nt.tagged is null then 'No' | |
else 'Yes' | |
end | |
from provider as p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with cte as ( | |
SELECT i.provider_id, i.provider_name_first, i.provider_name_last, primary_addr_line_1, | |
i.primary_addr_line_2, primary_addr_city, i.primary_addr_realm, i.primary_addr_zip, | |
i.provider_email, i.provider_phone, ispec.specialty_name, ispec.provider_specialty_primary, | |
i.imsid, i.npiid, i.meid, i.iv, i.ct, i.corenetworkct, | |
row_number() over (partition by i.provider_id order by case ispec.specialty_name | |
when 'Sleep Medicine' then (case ispec.provider_specialty_primary when 0 then '2' else '1' end) + '|1|' + ispec.specialty_name | |
when 'Neurology' then (case ispec.provider_specialty_primary when 0 then '2' else '1' end) + '|2|' + ispec.specialty_name | |
when 'Psychiatry' then (case ispec.provider_specialty_primary when 0 then '2' else '1' end) + '|3|' + ispec.specialty_name | |
when 'Internal Medicine' then (case ispec.provider_specialty_primary when 0 then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MONTH(e.event_start_time) AS event_month, YEAR(e.event_start_time) AS event_year, | |
SUM(ISNULL(influencer.is_influencer, 0)) AS is_influencer, | |
SUM(CASE WHEN ISNULL(influencer.is_influencer, 0) = 1 AND ISNULL(target_list.on_target_list, 0) = 1 THEN 0 ELSE ISNULL(target_list.on_target_list, 0) END) AS on_target_list, | |
SUM(CASE WHEN ISNULL(influencer.is_influencer, 0) + ISNULL(target_list.on_target_list, 0) >= 1 THEN 0 ELSE 1 END) AS is_other | |
FROM event_provider edr | |
INNER JOIN provider dr ON (dr.provider_id = edr.provider_id) | |
INNER JOIN roi_campaign_project rcp ON (rcp.project_id = dr.project_id) | |
INNER JOIN [event] e ON (e.event_id = edr.event_id) | |
LEFT OUTER JOIN (SELECT innerdr.provider_id, 1 AS is_influencer | |
FROM provider innerdr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tinkerpop.rexster; | |
import com.tinkerpop.blueprints.impls.tg.TinkerGraph; | |
import com.tinkerpop.rexster.server.DefaultRexsterApplication; | |
import com.tinkerpop.rexster.server.RexProRexsterServer; | |
import com.tinkerpop.rexster.server.RexsterApplication; | |
import com.tinkerpop.rexster.server.ShutdownManager; | |
import org.apache.commons.configuration.XMLConfiguration; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- attendees | |
SELECT rx_year, rx_month, product_name, SUM(nrx_cnt) AS rx_cnt | |
FROM provider_rx_segment prs | |
INNER JOIN provider dr ON (dr.provider_id = prs.provider_id) | |
INNER JOIN roi_campaign_project rcp ON (rcp.project_id = dr.project_id) | |
INNER JOIN event_provider edr ON (edr.provider_id = dr.provider_id) | |
WHERE rcp.roi_campaign_id = 1 and edr.event_role_id = 1 | |
GROUP BY rx_year, rx_month, product_name | |
order by rx_year, rx_month |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE [dbo].[roi_campaign_provider_stat] ADD DEFAULT ((0)) FOR [stat_states_provinces_influenced] | |
GO | |
ALTER TABLE [dbo].[roi_campaign_provider_stat] ADD DEFAULT ((0)) FOR [stat_zips_influenced] | |
GO | |
ALTER TABLE [dbo].[roi_campaign_provider_stat] ADD DEFAULT ((0)) FOR [stat_articles_published] | |
GO | |
ALTER TABLE [dbo].[roi_campaign_provider_stat] ADD DEFAULT ((0)) FOR [stat_clinical_trials_involved_in] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.thinkaurelius.faunus.formats.graphson; | |
import com.thinkaurelius.faunus.FaunusEdge; | |
import com.thinkaurelius.faunus.FaunusVertex; | |
import com.tinkerpop.blueprints.Direction; | |
import com.tinkerpop.blueprints.Edge; | |
import com.tinkerpop.blueprints.Vertex; | |
import com.tinkerpop.blueprints.util.io.graphson.ElementFactory; | |
import com.tinkerpop.blueprints.util.io.graphson.ElementPropertyConfig; | |
import com.tinkerpop.blueprints.util.io.graphson.GraphSONMode; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.provider_id, provider_name_last, provider_name_first, ISNULL(provider_default_score, 0) AS iv_score, | |
ISNULL(speaker.stat_rank, 0) AS speaker_score, COUNT(e.event_id) AS event_cnt, | |
SUM(attendees.cnt) AS attendee_cnt | |
FROM provider p | |
INNER JOIN event_provider ep ON (p.provider_id = ep.provider_id) | |
INNER JOIN [event] e ON (e.event_id = ep.event_id) | |
INNER JOIN roi_campaign_project rcp ON (rcp.project_id = p.project_id) | |
INNER JOIN roi_campaign rc ON (rc.roi_campaign_id = rcp.roi_campaign_id) | |
LEFT OUTER JOIN (SELECT event_id, COUNT(ep.provider_id) AS cnt | |
FROM event_provider ep |