Active Directory Penetration Testing, cionsystems.com.pdf
Store RDF(API creation) to Virtuoso via PHP language and Sparql queries
1. Group 3:
Krasadakis Stelios
Kornarakis Konstantinos
Semantic Web
Project: Store API
Technological Educational Institute of Crete
Applied Informatics and Multimedia
2. Store API goal was to create a RESTFul API with the appropriate Sparql queries in order to store RDF triples from
Virtuoso Sparql Endpoint into Virtuoso quad store.
Initially, in order to store Articles and Authors, 5th team has created a PHP form with Javascript validation checks
and for this reason we decided to make the programming part into PHP language.
Secondly, extend the capabilities of this application by configuring RESTFul API taking HTTP POST’s from Crawlers
and store them if they do not exist in our database. As a best practice we keep our database simple and small
without any duplicates of Articles or Authors.
In order to achieve this, we had to accomplish a connection with Virtuoso Endpoint and for this purposes we
found a library called “sparqllib” that provides connection and other useful available functions to Sparql
endpoints in general over PHP language.
Objectives
3. For our needs to provide a unique and auto increment identification instantiate for each Article and
Author before we execute Sparql Store Query, we do the following
Retrieve all Article instances,
Count rows of results,
And give the next id to the incoming Sparql Store query.
Variable countarticle will ensure the uniqueness of each Article store.
Auto Increment Instantiation
4. Insert Article
Abort insertion if Article already exists.
Approve insertion if Article does not exist.
Insert Author
Abort insertion if Author already exists.
Approve insertion if Author does not exist.
Insert Author & Article
Abort Article insertion if already exists.
Abort Article insertion if already exist, even if POST value for Author is different.
Approve insertion if Article does not exist with a new Author.
Approve insertion if Article does not exist with an existing Author.
Approve insertion if Article does not exist, even without an Author.
Duplicate Checks
5. Typical Store Sparql Query
Unique instantiate
each article &
author
$category = $_POST['category'];
6. Anyone can store articles or authors over:
1) Store from FORM: 83.212.124.52/api/2015/form/semantic/
2) STORE VIA REST API: 83.212.124.52/api/2015/form/crawlerpost/
With the appropriate variables to be POSTed over HTTP protocol:
ARTICLE PARAMETERS
•For ARTICLE TITLE variable : title
•For ARTICLE URL variable : url
•For ARTICLE CATEGORY variable : category
•For ARTICLE IMAGE variable : image
•For ARTICLE DATE CREATED variable: dateCreated
•For ARTICLE DATE UPDATED variable : dateUpdated
•For ARTICLE RATING variable : rating
REST API calls
7. • For ARTICLE DESCRIPTION variable : description
• For ARTICLE LANGUAGE variable : language
• For ARTICLE BODY variable : body
• For ARTICLE VIDEO variable : video
• For ARTICLE TAGS variable : tags
AUTHOR PARAMETERS
• For Author Full Name variable : authorName
• For Author Nickname variable: authornickname
• For Author Location variable : authorlocation
• For Author Biography variable : authorbiography
REST API calls (2)