RAP ontology centric model from owl file - php

For the past few days I'm struggling with the RAP API library.
Basically I've created an custom ontology which I want to use with this library, as they state it supports to work with ontologies.
But the load() method from the library generates some weird OntModel.
This is the code where I try to load my ontology:
$client = ModelFactory::getOntModel (MEMMODEL,OWL_VOCABULARY);
$client->load("myOntology.owl");
$querystring = '
SELECT ?model
WHERE ( ?Brand, <http://www.owl-ontologies.com/proj.owl#hasModel>, ?model )';
$result = $client->rdqlQuery($querystring);
rdqlEngine::writeQueryResultAsHtmlTable($Result);
Can someone help me ? On the RAP API library documentation they have an example describing only how to create an ontology, not how to read one from an file(or external URI).
Thanks in advance.
Later Edit
Here is the OntModel which was loaded: OntModel

Open Ontology in Protege and save it as "RDF/XML" instead of "OWL/XML" as I had done initially.

Related

Typo3 getting data and convert it to specific xml schema

i am new to typo3, so sorry, if this is too obvious.
I do not expect a complete solution, just the topics i would need to read about in order to solve the task would be perfectly enough. :)
Here the task:
I have a typo 3 installation with job advertisements in it. Now the company wants to publish that data in to a social website, which needs to have the job advertisement data put on a server in an xml feed, which looks like this: http://www.kununu.com/docs#jobfeed. Don't worry about what it says in there, it's just stuff like Job Title, Description etc.
Like i said, i am completely new to this and just have a vague idea.
My thoughts so far were something like this:
I probably need to write a plugin, which pulls the data out of typo3 by the push of a button
That Plugin need to establish a database connection to pull the data (probably it's mysql, but i am not entirely sure yet)
The data need to be formatted, which is either done by some string operations or by some kind of xml handler i assume.
Sidenote: I read something about TypoScript, but i'd like to avoid that, since it's a one time project and probably not worth the time to learn it. For me at least.
Thank you loads for your help in advance.
Cheers
you can handle that (basicly with typoscript). The other part has to come from PHP (F.e. extbase plugin) ... First part creates the XML output. Second part uses my Demo plugin to include data (Pages+special fields) from DB.
Within TS we are able to create a new typeNum. With that you can call your XML. ( ?type=1234 ) Within the BE you can select each page for output.
If you need help just contact me. I would send you the plugin.
sitemap = PAGE
sitemap {
typeNum = 1234
config {
# Set charset to utf-8
metaCharset = utf-8
# Deactivate TYPO3 Header Code
disableAllHeaderCode = 1
# Content-type settings
additionalHeaders = Content-type:text/xml;charset=utf-8
# Do not cache the page
no_cache = 1
# No xhtml cleaning trough TYPO3
xhtml_cleaning = 0
}
10 = USER_INT
10 {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
pluginName = Sitemap
extensionName = Srcxmlprovider
controller = Sitemap
vendorName = Sourcecrew
action = exportXml
switchableControllerActions {
Sitemap {
1 = exportXml
}
}
}
}
Ich habe die EXT noch schnell ins TER gepushed. Ein Tutorial liegt innerhalb.
http://typo3.org/extensions/repository/view/srcxmlprovider

How to use Filestore in API in Agiletoolkit?

i am working on an urgent project which involves implmentation of filestore of Agiletoolkit
i went through the doc here => http://agiletoolkit.org/doc/filestore
$f=$p->add('Form');
$c=$p->add('Controller_Filestore_File');
$c->setActualFields(array('id','filestore_type_id','filestore_volume_id','filename','filesize'));
$f->addField('upload','upload')->setController($c);
$p->add('H4')->set('Previously Uploaded Files');
$g=$p->add('MVCGrid')->setController($c);
$g->dq->limit(5)->order('id desc');
there is this example there
Questions:
Q1. I know i don't need to use MVCGrid addon here but why is it mentioend in this example? (its confusing me )
Q2. Filestore is a controller i get that .. so if i want it on multiple pages, do i add it in the API ?
Q3. If suppose i add something like that in api can i use it in all pages ? if yes then how ? $this->api-> WHAT ?
There was a small bug in filestore which is fixed now. So it should work fine. It was a bug in sql queries that were imported.

Modifying budget of an AdWord Campaign by using API

I am implementing adword api version 201306 in one of my project. I am able to fetch the details of a campaign but unable to retrieve the budget details.
My goal is to access the budget details and modify them. I am using PHP library and request to all of you a piece of code written in php.
Any help would be highly appreciated.
Thanks,
Pramod
I found the solution and here is the way you need to go out - -
First you need to pass out the field 'BudgetId' in Campaign Service selector for CampaignStats.
Now you can use following code - -
$budgetService = $user->GetService('BudgetService', ADWORDS_VERSION);
$bm = new Money('10000000');
$campaign->budget->amount = $bm;
$boperation = new BudgetOperation();
$boperation->operand = $campaign->budget;
$boperation->operator = 'SET';
$budgetService->mutate($boperation);
Yes, I agree that this help is very less. Do let me know if anyone face any issue OR need more help.
Regards,
Pramod

Drupal - fetch body text of a node via URL?

I'm trying to create a function to retrieve and display just the Body field of a Drupal node, based on a given URL.
Currently, I've extended the functionality of the standard Drupal RSS to do a detection method. This will happen if you enter the following url:
http://mysite.com/rss.xml/page=54
That last part is critical - it tells what node ID to load from. As far as code goes, I've modified the node_feed() function in /modules/node/node.module to do the following:
if (stristr($nids, 'page=') !== FALSE) {
$nid = substr($nids, stripos($nids, 'page=') + 5);
$result = NULL;
if ((string)(int)$nid === $nid) {
$result = db_result(db_query("SELECT `nid` FROM {node} WHERE `nid` = %s AND `type` = 'flashnode'", $nid));
}
if ($result) {
$item = node_load($result);
print($item->body);
}
exit;
}
While this works, we're worried about it for two reasons:
1) Do the results cache? This is a very heavy-load page that will be called a lot.
2) Is there an "official" way to do this? One that uses modules with caching, instead of a semi-hacky workaround?
Thanks in advance for any guidance.
-Tom
You should definitely not be hacking apart the RSS feed in order to create a URL that returns a node's body. You should create a very simple custom module: http://drupal.org/developing/modules
The Drupal module system is lets you set up a url so that something like /fetch_body/1234 calls the fetch_body() function with $nid=1234 as the parameter. As for caching, you have a lot of options in your custom module. The most obvious would be to use cache_get() and cache_set() to do simple caching on your own based on the node ID.
What version of Drupal are you using? I would highly recommend the book Pro Drupal Development, just make sure to get the edition that matches your drupal version.

Bugzilla Login and create bug

I been Googling reading trying week ago to do the following. I want to use Bugzilla API to create a new bug using PHP. There is an API so I don't want to work around but the problem is I can't login using the API.
I am using CodeIgniter FW and I found this after a long days of searching and reading:
public function tryBugZilla()
{
$this->load->library('xmlrpc');
$this->xmlrpc->server('http://link/xmlrpc.cgi', 80);
$this->xmlrpc->method('User.login');
$request = array('Bugzilla_login'=>'login', 'Bugzilla_password'=>'pass', 'product'=>'Your Product Name', 'component'=>'User Submitted', 'summary'=>'Test', 'version'=>'x.x', 'description'=>'asdas');
$this->xmlrpc->method('Bug.create');
$this->xmlrpc->request(array(array($request, 'struct')),'struct');
if(!$this->xmlrpc->send_request()) {
echo $this->xmlrpc->display_error();
}
// this returns ticket ID
print_r($this->xmlrpc->display_response());
//i get this:
// No data received from server
}
This is the source of the code
My Bugzilla version is 4.0.2
Also how can I use the Bugzilla REST API with PHP if its possible a sample code just for login I will continue
If you have the ability to use Zend libraries, then this might work for you:
http://petehowe.co.uk/2010/example-of-calling-the-bugzilla-api-using-php-zend-framework/
Also, here's a tutorial on using Zend with CI:
http://www.gotphp.com/codeigniter-with-zend-framework-libraries/54312/

Categories