add apache license header.
Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/e4cca3bc Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/e4cca3bc Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/e4cca3bc Branch: refs/heads/master Commit: e4cca3bc8f747da72b901066fb7e46eac506f0ef Parents: 35d9a43 Author: DO YUNG YOON <steams...@apache.org> Authored: Mon Apr 23 17:01:17 2018 +0900 Committer: DO YUNG YOON <steams...@apache.org> Committed: Mon Apr 23 17:01:17 2018 +0900 ---------------------------------------------------------------------- CHANGES | 1 + example/common.sh | 18 ++++++++++++- example/create_schema.sh | 18 ++++++++++++- example/import_data.sh | 18 ++++++++++++- example/movielens/desc.md | 30 ++++++++++++++++++++++ example/movielens/desc.txt | 8 ------ example/movielens/generate_input.sh | 16 ++++++++++++ example/movielens/jobdesc.template | 16 ++++++++++++ example/movielens/schema/edge.rated.graphql | 19 ++++++++++++++ example/movielens/schema/edge.related.graphql | 18 +++++++++++++ example/movielens/schema/edge.tagged.graphql | 18 +++++++++++++ example/movielens/schema/service.graphql | 18 +++++++++++++ example/movielens/schema/vertex.movie.graphql | 18 +++++++++++++ example/movielens/schema/vertex.tag.graphql | 18 +++++++++++++ example/movielens/schema/vertex.user.graphql | 18 +++++++++++++ example/prepare.sh | 16 ++++++++++++ example/run.sh | 26 +++++++++++++++---- s2jobs/README.md | 21 ++++++++++++++- 18 files changed, 298 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/CHANGES ---------------------------------------------------------------------- diff --git a/CHANGES b/CHANGES index 56c9203..2485fe8 100644 --- a/CHANGES +++ b/CHANGES @@ -73,6 +73,7 @@ Release Notes - S2Graph - Version 0.2.0 * [S2GRAPH-200] - docker image could not include extra jars. * [S2GRAPH-204] - Avoid N + 1 queries in GraphQL * [S2GRAPH-207] - Provides a way to query data with the value of the Vertex property in a GraphQL query + * [S2GRAPH-193] - Add README for S2Jobs sub-project ** New Feature * [S2GRAPH-123] - Support different index on out/in direction. http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/common.sh ---------------------------------------------------------------------- diff --git a/example/common.sh b/example/common.sh index 6b5b755..b7f3187 100644 --- a/example/common.sh +++ b/example/common.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. ROOTDIR=`pwd`/.. WORKDIR=`pwd` PREFIX="[s2graph] " @@ -29,7 +45,7 @@ usage() { graphql_rest() { file=$1 - value=`cat ${file} | sed 's/\"/\\\"/g'` + value=`cat ${file} | sed 's/\"/\\\"/g' | grep "^[^#]"` query=$(echo $value|tr -d '\n') echo $query http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/create_schema.sh ---------------------------------------------------------------------- diff --git a/example/create_schema.sh b/example/create_schema.sh old mode 100755 new mode 100644 index bce0db9..7ce9922 --- a/example/create_schema.sh +++ b/example/create_schema.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. source common.sh [ $# -ne 1 ] && { usage; } @@ -11,7 +27,7 @@ info "schema dir : $SCHEMA_HOME" q "generate input >>> " cd ${SERVICE_HOME} -./generate_input.sh +sh ./generate_input.sh q "create service >>> " graphql_rest ${SCHEMA_HOME}/service.graphql http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/import_data.sh ---------------------------------------------------------------------- diff --git a/example/import_data.sh b/example/import_data.sh old mode 100755 new mode 100644 index 6822c00..0cb9cd4 --- a/example/import_data.sh +++ b/example/import_data.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. source common.sh [ $# -ne 1 ] && { usage; } @@ -12,7 +28,7 @@ JAR=`ls ${ROOTDIR}/s2jobs/target/scala-2.11/s2jobs-assembly*.jar` info "WORKING_DIR : $WORKING_DIR" info "JAR : $JAR" -sed -e "s/\[=WORKING_DIR\]/${WORKING_DIR//\//\\/}/g" $JOBDESC_TPL > $JOBDESC +sed -e "s/\[=WORKING_DIR\]/${WORKING_DIR//\//\\/}/g" $JOBDESC_TPL | grep "^[^#]" > $JOBDESC unset HADOOP_CONF_DIR info "spark submit.." http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/desc.md ---------------------------------------------------------------------- diff --git a/example/movielens/desc.md b/example/movielens/desc.md new file mode 100644 index 0000000..b4e4777 --- /dev/null +++ b/example/movielens/desc.md @@ -0,0 +1,30 @@ +<!--- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +---> + +# MovieLens + +GroupLens Research has collected and made available rating data sets from the MovieLens web site (http://movielens.org). +The data sets were collected over various periods of time, depending on the size of the set. + +This dataset (ml-latest-small) describes 5-star rating and free-text tagging activity from MovieLens, a movie recommendation service. +It contains 100004 ratings and 1296 tag applications across 9125 movies. +These data were created by 671 users between January 09, 1995 and October 16, 2016. +This dataset was generated on October 17, 2016. http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/desc.txt ---------------------------------------------------------------------- diff --git a/example/movielens/desc.txt b/example/movielens/desc.txt deleted file mode 100644 index 0da9a86..0000000 --- a/example/movielens/desc.txt +++ /dev/null @@ -1,8 +0,0 @@ -MovieLens -GroupLens Research has collected and made available rating data sets from the MovieLens web site (http://movielens.org). -The data sets were collected over various periods of time, depending on the size of the set. - -This dataset (ml-latest-small) describes 5-star rating and free-text tagging activity from MovieLens, a movie recommendation service. -It contains 100004 ratings and 1296 tag applications across 9125 movies. -These data were created by 671 users between January 09, 1995 and October 16, 2016. -This dataset was generated on October 17, 2016. http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/generate_input.sh ---------------------------------------------------------------------- diff --git a/example/movielens/generate_input.sh b/example/movielens/generate_input.sh old mode 100755 new mode 100644 index b28640e..6c680b3 --- a/example/movielens/generate_input.sh +++ b/example/movielens/generate_input.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. INPUT=input mkdir -p ${INPUT} http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/jobdesc.template ---------------------------------------------------------------------- diff --git a/example/movielens/jobdesc.template b/example/movielens/jobdesc.template index ed62383..0b0f0ad 100644 --- a/example/movielens/jobdesc.template +++ b/example/movielens/jobdesc.template @@ -1,3 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. { "name": "import_movielens", "source": [ http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/edge.rated.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/edge.rated.graphql b/example/movielens/schema/edge.rated.graphql index 6e3c40f..bfb39f5 100644 --- a/example/movielens/schema/edge.rated.graphql +++ b/example/movielens/schema/edge.rated.graphql @@ -1,3 +1,22 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + mutation{ Management{ createLabel( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/edge.related.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/edge.related.graphql b/example/movielens/schema/edge.related.graphql index baf6e54..e20dba9 100644 --- a/example/movielens/schema/edge.related.graphql +++ b/example/movielens/schema/edge.related.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createLabel( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/edge.tagged.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/edge.tagged.graphql b/example/movielens/schema/edge.tagged.graphql index da5e997..b2e0275 100644 --- a/example/movielens/schema/edge.tagged.graphql +++ b/example/movielens/schema/edge.tagged.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createLabel( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/service.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/service.graphql b/example/movielens/schema/service.graphql index ed7e157..7bd8307 100644 --- a/example/movielens/schema/service.graphql +++ b/example/movielens/schema/service.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createService( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/vertex.movie.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/vertex.movie.graphql b/example/movielens/schema/vertex.movie.graphql index 3702a1e..4d7b3f7 100644 --- a/example/movielens/schema/vertex.movie.graphql +++ b/example/movielens/schema/vertex.movie.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createServiceColumn( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/vertex.tag.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/vertex.tag.graphql b/example/movielens/schema/vertex.tag.graphql index 05bd11c..89a4bc2 100644 --- a/example/movielens/schema/vertex.tag.graphql +++ b/example/movielens/schema/vertex.tag.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createServiceColumn( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/movielens/schema/vertex.user.graphql ---------------------------------------------------------------------- diff --git a/example/movielens/schema/vertex.user.graphql b/example/movielens/schema/vertex.user.graphql index bba8a16..09cd199 100644 --- a/example/movielens/schema/vertex.user.graphql +++ b/example/movielens/schema/vertex.user.graphql @@ -1,3 +1,21 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# mutation{ Management{ createServiceColumn( http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/prepare.sh ---------------------------------------------------------------------- diff --git a/example/prepare.sh b/example/prepare.sh old mode 100755 new mode 100644 index f35c94c..ebb78b8 --- a/example/prepare.sh +++ b/example/prepare.sh @@ -1,4 +1,20 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. source common.sh q "1. s2graphql is running?" http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/example/run.sh ---------------------------------------------------------------------- diff --git a/example/run.sh b/example/run.sh old mode 100755 new mode 100644 index 08f2989..fd324ac --- a/example/run.sh +++ b/example/run.sh @@ -1,9 +1,25 @@ #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. source common.sh SERVICE="movielens" [ $# -gt 0 ] && { SERVICE=$1; } -DESC=`cat $SERVICE/desc.txt` +DESC=`cat $SERVICE/desc.md` info "" info "" @@ -11,17 +27,17 @@ info "Let's try to create the toy project '$SERVICE' using s2graphql and s2jobs. info "" while IFS='' read -r line || [[ -n "$line" ]]; do info "$line" -done < "$SERVICE/desc.txt" +done < "$SERVICE/desc.md" q "First of all, we will check prerequisites" -./prepare.sh $SERVICE +sh ./prepare.sh $SERVICE [ $? -ne 0 ] && { exit -1; } q "And now, we create vertex and edge schema using graphql" -./create_schema.sh $SERVICE +sh ./create_schema.sh $SERVICE [ $? -ne 0 ] && { exit -1; } q "Finally, we import example data to service" -./import_data.sh $SERVICE +sh ./import_data.sh $SERVICE [ $? -ne 0 ] && { exit -1; } http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/e4cca3bc/s2jobs/README.md ---------------------------------------------------------------------- diff --git a/s2jobs/README.md b/s2jobs/README.md index 2315e82..505f2c4 100644 --- a/s2jobs/README.md +++ b/s2jobs/README.md @@ -1,4 +1,23 @@ - +<!--- +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +---> # S2Jobs